From 7eaa7a5490a15fd09f0f46cb4e64eadd1c774f1e Mon Sep 17 00:00:00 2001 From: Brian Wylie Date: Fri, 9 Feb 2024 12:26:37 -0700 Subject: [PATCH] linter formatting --- .../sageworks_core/sageworks_core/sageworks_core_stack.py | 1 + .../core/transforms/model_to_endpoint/model_to_endpoint.py | 6 ++++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/aws_setup/sageworks_core/sageworks_core/sageworks_core_stack.py b/aws_setup/sageworks_core/sageworks_core/sageworks_core_stack.py index c1c3ba91f..89386a8da 100644 --- a/aws_setup/sageworks_core/sageworks_core/sageworks_core_stack.py +++ b/aws_setup/sageworks_core/sageworks_core/sageworks_core_stack.py @@ -470,6 +470,7 @@ def sageworks_featureset_policy(self) -> iam.ManagedPolicy: """In SageMaker, certain operations, such as creating training jobs, endpoint deployments, or batch transform jobs, require SageMaker to assume an IAM role. This role provides SageMaker with permissions to access AWS resources on your behalf, such as reading training data from S3, writing model artifacts, or logging to CloudWatch.""" + def sagemaker_pass_role_policy_statement(self) -> iam.PolicyStatement: """Create a policy statement for SageMaker to assume the Execution Role diff --git a/src/sageworks/core/transforms/model_to_endpoint/model_to_endpoint.py b/src/sageworks/core/transforms/model_to_endpoint/model_to_endpoint.py index f45d9bf37..fb7273dfa 100644 --- a/src/sageworks/core/transforms/model_to_endpoint/model_to_endpoint.py +++ b/src/sageworks/core/transforms/model_to_endpoint/model_to_endpoint.py @@ -124,8 +124,10 @@ def _serverless_deploy(self, model_package_arn, mem_size=2048, max_concurrency=5 ) except ClientError as e: # Already Exists: Check if ValidationException and existing endpoint configuration - if e.response['Error']['Code'] == 'ValidationException' and \ - "already existing endpoint configuration" in e.response['Error']['Message']: + if ( + e.response["Error"]["Code"] == "ValidationException" + and "already existing endpoint configuration" in e.response["Error"]["Message"] + ): self.log.warning("Endpoint configuration already exists: Deleting and retrying...") self.sm_client.delete_endpoint_config(EndpointConfigName=endpoint_name) self.sm_client.create_endpoint_config(