Skip to content

Commit 5ac66e7

Browse files
committed
address PR comments
1 parent 810f2ad commit 5ac66e7

File tree

3 files changed

+3
-10
lines changed

3 files changed

+3
-10
lines changed

src/sagemaker/image_uris.py

+2-6
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ def _config_for_framework_and_scope(framework, image_scope, accelerator_type=Non
7878

7979
if accelerator_type:
8080
if image_scope not in ("eia", "inference"):
81-
logger.info(
81+
logger.warning(
8282
"Elastic inference is for inference only. Ignoring image scope: %s.", image_scope
8383
)
8484
image_scope = "eia"
@@ -156,8 +156,4 @@ def _validate_arg(arg_name, arg, available_options):
156156

157157
def _format_tag(version, processor, py_version):
158158
"""Creates a tag for the image URI."""
159-
tag = "{}-{}".format(version, processor)
160-
if py_version:
161-
tag += "-{}".format(py_version)
162-
163-
return tag
159+
return "-".join([x for x in (version, processor, py_version) if x])

tests/unit/sagemaker/image_uris/test_dlc_frameworks.py

+1-3
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,7 @@
4848

4949
def _expected_uri(repo, fw_version, account, py_version=None, processor="cpu", region=REGION):
5050
domain = ALTERNATE_DOMAINS.get(region, DOMAIN)
51-
tag = "{}-{}".format(fw_version, processor)
52-
if py_version:
53-
tag = "-".join((tag, py_version))
51+
tag = "-".join([x for x in (fw_version, processor, py_version) if x])
5452

5553
return IMAGE_URI_FORMAT.format(account, region, domain, repo, tag)
5654

tests/unit/sagemaker/image_uris/test_retrieve.py

-1
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,6 @@ def test_retrieve_eia(config_for_framework, caplog):
9191
)
9292
assert "123412341234.dkr.ecr.us-west-2.amazonaws.com/dummy-eia:1.0.0-cpu-py3" == uri
9393

94-
caplog.set_level(logging.INFO)
9594
uri = image_uris.retrieve(
9695
framework="useless-string",
9796
version="1.0.0",

0 commit comments

Comments
 (0)