Skip to content

Commit 46d2a46

Browse files
committed
Map image name to image uri
1 parent 8466dfe commit 46d2a46

File tree

2 files changed

+15
-0
lines changed

2 files changed

+15
-0
lines changed

src/sagemaker/estimator.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2121,6 +2121,9 @@ def __init__(
21212121
:class:`~sagemaker.estimator.EstimatorBase`.
21222122
"""
21232123
super(Framework, self).__init__(enable_network_isolation=enable_network_isolation, **kwargs)
2124+
image_uri = renamed_kwargs(
2125+
"image_name", "image_uri", image_uri, kwargs
2126+
)
21242127
if entry_point.startswith("s3://"):
21252128
raise ValueError(
21262129
"Invalid entry point script: {}. Must be a path to a local file.".format(

tests/unit/test_estimator.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3209,3 +3209,15 @@ def test_estimator_local_mode_ok(sagemaker_local_session):
32093209
sagemaker_session=sagemaker_local_session,
32103210
base_job_name="base_job_name",
32113211
)
3212+
3213+
3214+
def test_image_name_map(sagemaker_session):
3215+
e = DummyFramework(
3216+
"my_script.py",
3217+
image_name=IMAGE_URI,
3218+
role=ROLE,
3219+
instance_count=INSTANCE_COUNT,
3220+
instance_type=INSTANCE_TYPE,
3221+
)
3222+
3223+
assert e.image_uri == IMAGE_URI

0 commit comments

Comments
 (0)