Skip to content

Replace unnecessary dict.items() with dict.values() in sagemaker mock#19090

Merged
harupy merged 2 commits intomasterfrom
copilot/replace-dict-items-with-values
Nov 27, 2025
Merged

Replace unnecessary dict.items() with dict.values() in sagemaker mock#19090
harupy merged 2 commits intomasterfrom
copilot/replace-dict-items-with-values

Conversation

Copy link
Contributor

Copilot AI commented Nov 27, 2025

Related Issues/PRs

#xxx

What 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?

  • Existing unit/integration tests
  • New unit/integration tests
  • Manual tests

Release Notes

Is this a user-facing change?

  • No. You can skip the rest of this section.
  • Yes. Give a description of this change to be included in the release notes for MLflow users.

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" section
  • rn/breaking-change - The PR will be mentioned in the "Breaking Changes" section
  • rn/feature - A new user-facing feature worth mentioning in the release notes
  • rn/bug-fix - A user-facing bug fix worth mentioning in the release notes
  • rn/documentation - A user-facing documentation change worth mentioning in the release notes

Should this PR be included in the next patch release?

  • Yes (this PR will be cherry-picked and included in the next patch release)
  • No (this PR will be included in the next minor release)
Original prompt

Replace unnecessary dict.items with dict.values in tests/sagemaker/mock/init.py


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

@harupy harupy marked this pull request as ready for review November 27, 2025 13:19
@github-actions
Copy link
Contributor

@Copilot Thank you for the contribution! Could you fix the following issue(s)?

⚠ Invalid PR template

This 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
Copilot AI requested a review from harupy November 27, 2025 13:33
@github-actions github-actions bot added the rn/none List under Small Changes in Changelogs. label Nov 27, 2025
@harupy harupy enabled auto-merge November 27, 2025 13:55
@harupy harupy disabled auto-merge November 27, 2025 14:16
@harupy harupy merged commit 637130e into master Nov 27, 2025
52 of 75 checks passed
@harupy harupy deleted the copilot/replace-dict-items-with-values branch November 27, 2025 14:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

rn/none List under Small Changes in Changelogs.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants