Repository navigation
Rename shadowed --version on sagemaker image version waiters - #10756
Open
GarrettBeatty wants to merge 1 commit into
Open
GarrettBeatty wants to merge 1 commit into
GarrettBeatty wants to merge 1 commit into
Conversation
GarrettBeatty
added this pull request to stack #10758
October 14, 2026 15:05
GarrettBeatty
marked this pull request as ready for review
October 14, 2026 15:24
The `sagemaker wait image-version-created` and `image-version-deleted` waiters exposed the DescribeImageVersion `Version` member as `--version`, which is captured by the global `--version` option before the waiter's arguments are parsed, so it could never be used. The corresponding image version operations already rename it to `--version-number`, but waiter argument tables emit `building-argument-table.wait.<waiter>`, so that rename never applied to them. Add the waiter renames (and their lazy handler registry entries) so the waiters accept `--version-number`, consistent with the operations.
GarrettBeatty
force-pushed
the
sagemaker-waiter-version-rename
branch
from
October 14, 2026 16:50
fe4c4de to
635d844
Compare
This branch has not been 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.
Summary
aws sagemaker wait image-version-createdandaws sagemaker wait image-version-deletedexposed the
DescribeImageVersionVersionmember as--version. The CLI resolvesglobal options before command arguments, so
--versionis always captured by theglobal
--versionoption and the waiter parameter can never be used:The corresponding operations (
describe-image-version,delete-image-version,update-image-version,list-aliases) already rename this parameter to--version-numberinargrename.py. Waiter commands emitbuilding-argument-table.wait.<waiter-name>rather thanbuilding-argument-table.sagemaker.<operation>, so that rename never applied to thewaiters.
Changes
ARGUMENT_RENAMESentries for the two waiters (--version->--version-number).handlers_registry.pyso the lazily initializedregister_arg_renameshandler is loaded for these waiter events.--version-numberand send it asVersion.This is not backwards-incompatible: the waiters'
--versionwas unreachable, so noworking invocation changes.
Context
Found by the extended builtin-shadowing audit in #10700 (CLI-9380), which now walks the
full command tree, including waiters. #10700 is stacked on this PR, so it can be merged
without needing an allowlist for these two commands.
Testing
tests/functional/sagemaker/test_waiters.py: new tests fail before this change(
Unknown options: --version-number) and pass after.tests/unit/customizations/test_argrename.py,tests/unit/test_lazy_emitter.py,tests/functional/test_handlers_registry.py,tests/functional/test_lazy.py,tests/functional/docs: 11,871 passed.