Repository navigation
Conversation
get_base_python_image_uri previously accepted any string for py_version without validation, returning image URIs for non-existent base images in ECR (such as 311 or 313) that failed downstream at job execution. Add py_versions configuration to sagemaker-base-python.json (310, 38) and validate py_version via _validate_py_version_and_set_if_needed, raising a clear ValueError when an unsupported version is requested. Also add unit test coverage for invalid python versions. Fixes aws#6539
Fire162
requested a deployment
to
manual-approval
October 29, 2026 02:14 — with
GitHub Actions
Waiting
Fire162
requested a deployment
to
manual-approval
October 29, 2026 02:14 — with
GitHub Actions
Waiting
Fire162
requested a deployment
to
manual-approval
October 29, 2026 02:14 — with
GitHub Actions
Waiting
This branch is waiting to be deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Issue #, if available
Fixes #6539
Description
get_base_python_image_uripreviously accepted any string forpy_versionwithout validation. For Python versions without base images in ECR (such as311or313), it returned image URIs that failed downstream during job creation when pulling from ECR.Fix
"py_versions": ["310", "38"]toversions["1.0"]insagemaker-core/src/sagemaker/core/image_uri_config/sagemaker-base-python.json.get_base_python_image_urivia_validate_py_version_and_set_if_needed, matching how framework image URIs validate python versions across the SDK.ValueErrorraised on unsupported versions.sagemaker-core/tests/unit/image_uris/test_base_python.pyfor unsupported python versions.Testing done
pytest sagemaker-core/tests/unit/image_uris/test_base_python.py-> 7 passed.310,38) resolve expected URIs across all regions.311,312,313,39,invalid) raiseValueError: Unsupported Python version.Merge Checklist
Tests
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.