MAINT Enable ruff UP (pyupgrade) rules and fix all violations#1389
Merged
romanlutz merged 1 commit intoAzure:mainfrom Feb 25, 2026
Merged
MAINT Enable ruff UP (pyupgrade) rules and fix all violations#1389romanlutz merged 1 commit intoAzure:mainfrom
romanlutz merged 1 commit intoAzure:mainfrom
Conversation
Contributor
|
what is the rationale for moving to implicit optional ? it seems like we shouldn't do this by default and should use https://docs.astral.sh/ruff/rules/implicit-optional/ |
Contributor
Author
Yes, we're getting rid of implicit optional. But instead of |
hannahwestra25
approved these changes
Feb 25, 2026
Modernize deprecated typing imports (List->list, Dict->dict, Tuple->tuple, Set->set, Type->type, FrozenSet->frozenset, Sequence/MutableSequence from collections.abc). Ignore UP007 (Union syntax) and UP045 (Optional syntax) to keep existing Optional[X] and Union[X, Y] patterns. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
b177e25 to
17353dd
Compare
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.


Enable ruff UP (pyupgrade) rules to modernize deprecated typing imports across the codebase (245 files, ~1175 lines changed).
Enabled rules
Ignored rules
What changed
Modernizes deprecated typing imports to their built-in equivalents:
Removes the now-unused deprecated imports from typing via the existing F401 rule.
Optional[X] and Union[X, Y] syntax is intentionally preserved per team preference.
Tests and Documentation
All unit tests pass. No documentation changes needed.