Replace unnecessary dict.items() with dict.values() in sagemaker mock#19090
Merged
Replace unnecessary dict.items() with dict.values() in sagemaker mock#19090
Conversation
Contributor
|
@Copilot Thank you for the contribution! Could you fix the following issue(s)? ⚠ Invalid PR templateThis PR does not appear to have been filed using the MLflow PR template. Please copy the PR template from here and fill it out. |
…r/mock/__init__.py Co-authored-by: harupy <17039389+harupy@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Replace unnecessary dict.items with dict.values in tests
Replace unnecessary dict.items() with dict.values() in sagemaker mock
Nov 27, 2025
harupy
approved these changes
Nov 27, 2025
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.
Related Issues/PRs
#xxxWhat changes are proposed in this pull request?
Four methods in the SageMaker mock backend were iterating over dictionaries using
.items()but discarding the keys with_. Replaced with direct.values()iteration:list_endpoints():for _, endpoint in self.endpoints.items()→for endpoint in self.endpoints.values()list_endpoint_configs():for _, endpoint_config in self.endpoint_configs.items()→for endpoint_config in self.endpoint_configs.values()list_models():for _, model in self.models.items()→for model in self.models.values()list_transform_jobs():for _, transform_job in self.transform_jobs.items()→for transform_job in self.transform_jobs.values()How is this PR tested?
Release Notes
Is this a user-facing change?
How should the PR be classified in the release notes? Choose one:
rn/none- No description will be included. The PR will be mentioned only by the PR number in the "Small Bugfixes and Documentation Updates" sectionrn/breaking-change- The PR will be mentioned in the "Breaking Changes" sectionrn/feature- A new user-facing feature worth mentioning in the release notesrn/bug-fix- A user-facing bug fix worth mentioning in the release notesrn/documentation- A user-facing documentation change worth mentioning in the release notesShould this PR be included in the next patch release?
Original prompt
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.