Skip to content

Commit 5a09716

Browse files
akuma12akrishna1995
authored andcommitted
Fix lint issues
1 parent fee0a83 commit 5a09716

File tree

2 files changed

+11
-6
lines changed

2 files changed

+11
-6
lines changed

src/sagemaker/processing.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1882,7 +1882,9 @@ def _get_codeartifact_command(self, codeartifact_repo_arn: str) -> str:
18821882
region,
18831883
)
18841884

1885-
return f"aws codeartifact login --tool pip --domain {domain} --domain-owner {owner} --repository {repository} --region {region}" # pylint: disable=line-too-long
1885+
return "aws codeartifact login --tool pip --domain {} --domain-owner {} --repository {} --region {}".format( # noqa: E501 pylint: disable=line-too-long
1886+
domain, owner, repository, region
1887+
)
18861888

18871889
def _generate_framework_script(
18881890
self, user_script: str, codeartifact_repo_arn: str = None

tests/unit/test_processing.py

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1117,8 +1117,8 @@ def test_get_codeartifact_command(pipeline_session):
11171117
)
11181118

11191119
codeartifact_command = processor._get_codeartifact_command(codeartifact_repo_arn=codeartifact_repo_arn)
1120-
1121-
assert codeartifact_command == "aws codeartifact login --tool pip --domain test-domain --domain-owner 012345678901 --repository test-repository --region us-west-2"
1120+
1121+
assert codeartifact_command == "aws codeartifact login --tool pip --domain test-domain --domain-owner 012345678901 --repository test-repository --region us-west-2" # noqa: E501
11221122

11231123

11241124
@patch("sagemaker.workflow.utilities._pipeline_config", MOCKED_PIPELINE_CONFIG)
@@ -1137,6 +1137,7 @@ def test_get_codeartifact_command_bad_repo_arn(pipeline_session):
11371137
with pytest.raises(ValueError):
11381138
processor._get_codeartifact_command(codeartifact_repo_arn=codeartifact_repo_arn)
11391139

1140+
11401141
@patch("sagemaker.workflow.utilities._pipeline_config", MOCKED_PIPELINE_CONFIG)
11411142
def test_generate_framework_script(pipeline_session):
11421143
processor = PyTorchProcessor(
@@ -1177,7 +1178,8 @@ def test_generate_framework_script(pipeline_session):
11771178
python process.py "$@"
11781179
"""
11791180
)
1180-
1181+
1182+
11811183
@patch("sagemaker.workflow.utilities._pipeline_config", MOCKED_PIPELINE_CONFIG)
11821184
def test_generate_framework_script_with_codeartifact(pipeline_session):
11831185
processor = PyTorchProcessor(
@@ -1209,7 +1211,7 @@ def test_generate_framework_script_with_codeartifact(pipeline_session):
12091211
if ! hash aws 2>/dev/null; then
12101212
echo "AWS CLI is not installed. Skipping CodeArtifact login."
12111213
else
1212-
"aws codeartifact login --tool pip --domain test-domain --domain-owner 012345678901 --repository test-repository --region us-west-2"
1214+
aws codeartifact login --tool pip --domain test-domain --domain-owner 012345678901 --repository test-repository --region us-west-2
12131215
fi
12141216
12151217
# Some py3 containers has typing, which may breaks pip install
@@ -1219,9 +1221,10 @@ def test_generate_framework_script_with_codeartifact(pipeline_session):
12191221
fi
12201222
12211223
python process.py "$@"
1222-
"""
1224+
""" # noqa: E501
12231225
)
12241226

1227+
12251228
def _get_script_processor(sagemaker_session):
12261229
return ScriptProcessor(
12271230
role=ROLE,

0 commit comments

Comments
 (0)