Skip to content

Commit 5bc5d16

Browse files
ndodda-amazonmetrizable
authored andcommitted
feature: Map image name to image uri (#2100)
* Map image name to image uri * fix bug in test
1 parent ccca21f commit 5bc5d16

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

src/sagemaker/estimator.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2122,6 +2122,7 @@ def __init__(
21222122
:class:`~sagemaker.estimator.EstimatorBase`.
21232123
"""
21242124
super(Framework, self).__init__(enable_network_isolation=enable_network_isolation, **kwargs)
2125+
image_uri = renamed_kwargs("image_name", "image_uri", image_uri, kwargs)
21252126
if entry_point.startswith("s3://"):
21262127
raise ValueError(
21272128
"Invalid entry point script: {}. Must be a path to a local file.".format(

tests/unit/test_estimator.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3243,3 +3243,16 @@ def test_framework_distribution_configuration(sagemaker_session):
32433243
"sagemaker_instance_type": INSTANCE_TYPE,
32443244
}
32453245
assert actual_ddp == expected_ddp
3246+
3247+
3248+
def test_image_name_map(sagemaker_session):
3249+
e = DummyFramework(
3250+
"my_script.py",
3251+
image_name=IMAGE_URI,
3252+
role=ROLE,
3253+
sagemaker_session=sagemaker_session,
3254+
instance_count=INSTANCE_COUNT,
3255+
instance_type=INSTANCE_TYPE,
3256+
)
3257+
3258+
assert e.image_uri == IMAGE_URI

0 commit comments

Comments
 (0)