fix: use identity check for type comparison and avoid mutable default argument - #6742
Open
harshadkhetpal wants to merge 1 commit into
Open
Conversation
… argument Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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
Two small lint/correctness fixes:
sdk/python/feast/diff/registry_diff.py—assert type(current_proto) == type(new_proto)compares type objects with==. Newer ruff flags this as E721 (which is inside theE7family this repo selects inpyproject.toml), and identity is the intended semantics for type objects:sdk/python/feast/api/registry/rest/rest_utils.py—validate_or_set_default_sorting_params(sort_by_options: List[str] = [])uses a mutable default argument (ruff B006). Changed to theOptional[...] = Nonesentinel. Behavior is unchanged: the inner dependency only ever checks truthiness (if not sort_by_options:), which treatsNoneand[]identically.Testing
No behavior change —
python -m py_compileandruff check --select E721,B006pass on both files. Theregistry_diff.pychange preserves the file's existing line endings.🤖 Generated with Claude Code