Skip to content

Commit 1c7f167

Browse files
fix: black check failure
1 parent f775706 commit 1c7f167

File tree

3 files changed

+14
-11
lines changed

3 files changed

+14
-11
lines changed

src/sagemaker/workflow/pipeline.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -184,17 +184,16 @@ def upsert(
184184
response = self.update(role_arn, description)
185185
if tags is not None:
186186
old_tags = self.sagemaker_session.sagemaker_client.list_tags(
187-
ResourceArn=response["PipelineArn"])["Tags"]
187+
ResourceArn=response["PipelineArn"]
188+
)["Tags"]
188189

189190
tag_keys = [tag["Key"] for tag in old_tags]
190191

191192
self.sagemaker_session.sagemaker_client.delete_tags(
192-
ResourceArn=response["PipelineArn"],
193-
TagKeys=tag_keys
193+
ResourceArn=response["PipelineArn"], TagKeys=tag_keys
194194
)
195195
self.sagemaker_session.sagemaker_client.add_tags(
196-
ResourceArn=response["PipelineArn"],
197-
Tags=tags
196+
ResourceArn=response["PipelineArn"], Tags=tags
198197
)
199198
else:
200199
raise

tests/integ/test_workflow.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -458,7 +458,9 @@ def test_one_step_sklearn_processing_pipeline(
458458
# sagemaker entities. However, the jobs created in the steps themselves execute
459459
# under a potentially different role, often requiring access to S3 and other
460460
# artifacts not required to during creation of the jobs in the pipeline steps.
461-
response = pipeline.create(role, tags=[{"Key": "foo", "Value": "abc"}, {"Key": "bar", "Value": "xyz"}])
461+
response = pipeline.create(
462+
role, tags=[{"Key": "foo", "Value": "abc"}, {"Key": "bar", "Value": "xyz"}]
463+
)
462464
create_arn = response["PipelineArn"]
463465
assert re.match(
464466
fr"arn:aws:sagemaker:{region_name}:\d{{12}}:pipeline/{pipeline_name}",
@@ -469,7 +471,9 @@ def test_one_step_sklearn_processing_pipeline(
469471
assert tag in original_tags["Tags"]
470472

471473
pipeline.parameters = [ParameterInteger(name="InstanceCount", default_value=1)]
472-
response = pipeline.upsert(role, tags=[{"Key": "abc", "Value": "foo"}, {"Key": "xyz", "Value": "bar"}])
474+
response = pipeline.upsert(
475+
role, tags=[{"Key": "abc", "Value": "foo"}, {"Key": "xyz", "Value": "bar"}]
476+
)
473477
update_arn = response["PipelineArn"]
474478
assert re.match(
475479
fr"arn:aws:sagemaker:{region_name}:\d{{12}}:pipeline/{pipeline_name}",

tests/unit/sagemaker/workflow/test_pipeline.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -103,9 +103,7 @@ def test_pipeline_upsert(sagemaker_session_mock, role_arn):
103103
},
104104
),
105105
{"PipelineArn": "mock_pipeline_arn"},
106-
[
107-
{"Key": "dummy", "Value": "dummy_tag"}
108-
],
106+
[{"Key": "dummy", "Value": "dummy_tag"}],
109107
{},
110108
{},
111109
]
@@ -128,7 +126,9 @@ def test_pipeline_upsert(sagemaker_session_mock, role_arn):
128126
assert sagemaker_session_mock.sagemaker_client.update_pipeline.called_with(
129127
PipelineName="MyPipeline", PipelineDefinition=pipeline.definition(), RoleArn=role_arn
130128
)
131-
assert sagemaker_session_mock.sagemaker_client.list_tags.called_with(ResourceArn="mock_pipeline_arn")
129+
assert sagemaker_session_mock.sagemaker_client.list_tags.called_with(
130+
ResourceArn="mock_pipeline_arn"
131+
)
132132
assert sagemaker_session_mock.sagemaker_client.delete_tags(
133133
ResourceArn="mock_pipeline_arn", TagKeys=["dummy"]
134134
)

0 commit comments

Comments
 (0)