Skip to content

fix: selector use provided models and fix mypy#5148

Merged
eakmanrq merged 1 commit intomainfrom
eakmanrq/selector_bug_and_mypy
Aug 14, 2025
Merged

fix: selector use provided models and fix mypy#5148
eakmanrq merged 1 commit intomainfrom
eakmanrq/selector_bug_and_mypy

Conversation

@eakmanrq
Copy link
Collaborator

Was getting a mypy issue since it would complain that models could be None. Reviewing and I identified a bug on line 216 where we didn't use the provided models. Therefore address both in this PR.

@eakmanrq eakmanrq requested a review from Copilot August 13, 2025 16:18
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR fixes two issues: a mypy error where models could be None and a bug where the provided models parameter wasn't being used in the Git selector logic. The changes rename the models variable to all_models to avoid confusion and ensure all references use the resolved models dictionary.

  • Resolved mypy error by properly handling the optional models parameter
  • Fixed bug where Git selector used self._models instead of the provided models parameter
  • Improved code clarity by renaming variables to avoid shadowing

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

model
for tag, models in models_by_tags.items()
for model in models
for model in all_models
Copy link

Copilot AI Aug 13, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This line should iterate over models (the model names from the tag mapping) rather than all_models. The correct iteration should be for model in models to match the models found for the specific tag pattern.

Suggested change
for model in all_models
for model in models

Copilot uses AI. Check for mistakes.
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't see why this would be the case.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah actually this was correct. models is redefined in the for loop. 🤦

@eakmanrq eakmanrq force-pushed the eakmanrq/selector_bug_and_mypy branch from e67079b to 5766ad2 Compare August 13, 2025 17:05
@izeigerman
Copy link
Collaborator

do we need any tests here?

@eakmanrq eakmanrq merged commit 2897b4e into main Aug 14, 2025
26 of 28 checks passed
@eakmanrq eakmanrq deleted the eakmanrq/selector_bug_and_mypy branch August 14, 2025 15:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants