Skip to content

Commit

Permalink
Ran linter
Browse files Browse the repository at this point in the history
  • Loading branch information
ivanmkc committed Apr 30, 2021
1 parent 348dae9 commit 4131edf
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 19 deletions.
Expand Up @@ -12,17 +12,17 @@
# See the License for the specific language governing permissions and
# limitations under the License.

from typing import Dict, Optional, Sequence, Tuple

from google.cloud import aiplatform
from typing import Optional, Sequence, Tuple, Dict
from google.cloud.aiplatform import explain


# [START aiplatform_sdk_deploy_model_with_automatic_resources_sample]
def deploy_model_with_automatic_resources_sample(
project,
location,
model_name: str,
endpoint: Optional["Endpoint"] = None,
endpoint: Optional[aiplatform.Endpoint] = None,
deployed_model_display_name: Optional[str] = None,
traffic_percentage: Optional[int] = 0,
traffic_split: Optional[Dict[str, int]] = None,
Expand Down
Expand Up @@ -12,18 +12,19 @@
# See the License for the specific language governing permissions and
# limitations under the License.

from typing import Dict, Optional, Sequence, Tuple

from google.cloud import aiplatform
from typing import Optional, Sequence, Tuple, Dict
from google.cloud.aiplatform import explain


# [START aiplatform_sdk_deploy_model_with_dedicated_resources_sample]
def deploy_model_with_dedicated_resources_sample(
project,
location,
model_name: str,
machine_type: str,
endpoint: Optional["Endpoint"] = None,
endpoint: Optional[aiplatform.Endpoint] = None,
deployed_model_display_name: Optional[str] = None,
traffic_percentage: Optional[int] = 0,
traffic_split: Optional[Dict[str, int]] = None,
Expand Down
9 changes: 2 additions & 7 deletions samples/model-builder/get_model_sample.py
Expand Up @@ -14,15 +14,10 @@


from google.cloud import aiplatform
from typing import Optional, Sequence, Dict
from google.cloud.aiplatform import explain


# [START aiplatform_sdk_get_model_sample]
def get_model_sample(
project: str,
location: str,
model_name: str
):
def get_model_sample(project: str, location: str, model_name: str):

aiplatform.init(project=project, location=location)

Expand Down
4 changes: 1 addition & 3 deletions samples/model-builder/get_model_test.py
Expand Up @@ -29,6 +29,4 @@ def test_get_model_sample(mock_sdk_init, mock_init_model):
project=constants.PROJECT, location=constants.LOCATION
)

mock_init_model.assert_called_once_with(
model_name=constants.MODEL_NAME
)
mock_init_model.assert_called_once_with(model_name=constants.MODEL_NAME)
3 changes: 2 additions & 1 deletion samples/model-builder/upload_model_sample.py
Expand Up @@ -12,11 +12,12 @@
# See the License for the specific language governing permissions and
# limitations under the License.

from typing import Dict, Optional, Sequence

from google.cloud import aiplatform
from typing import Optional, Sequence, Dict
from google.cloud.aiplatform import explain


# [START aiplatform_sdk_upload_model_sample]
def upload_model_sample(
project: str,
Expand Down
5 changes: 2 additions & 3 deletions samples/model-builder/upload_model_test.py
Expand Up @@ -12,9 +12,8 @@
# See the License for the specific language governing permissions and
# limitations under the License.


import upload_model_sample
import test_constants as constants
import upload_model_sample


def test_upload_model_sample(mock_sdk_init, mock_upload_model):
Expand All @@ -36,7 +35,7 @@ def test_upload_model_sample(mock_sdk_init, mock_upload_model):
serving_container_environment_variables=constants.SERVING_CONTAINER_ENVIRONMENT_VARIABLES,
serving_container_ports=constants.SERVING_CONTAINER_PORTS,
explanation_metadata=constants.EXPLANATION_METADATA,
explanation_parameters=constants.EXPLANATION_PARAMETERS
explanation_parameters=constants.EXPLANATION_PARAMETERS,
)

mock_sdk_init.assert_called_once_with(
Expand Down

0 comments on commit 4131edf

Please sign in to comment.