Skip to content

fix: Use identity check for type comparison and avoid mutable default argument - #6742

Open
harshadkhetpal wants to merge 1 commit into
feast-dev:masterfrom
harshadkhetpal:fix/type-identity-and-mutable-default
Open

harshadkhetpal wants to merge 1 commit into
feast-dev:masterfrom
harshadkhetpal:fix/type-identity-and-mutable-default

Conversation

@harshadkhetpal

Copy link
Copy Markdown

Summary

Two small lint/correctness fixes:

  1. sdk/python/feast/diff/registry_diff.pyassert type(current_proto) == type(new_proto) compares type objects with ==. Newer ruff flags this as E721 (which is inside the E7 family this repo selects in pyproject.toml), and identity is the intended semantics for type objects:
# Before
assert type(current_proto) == type(new_proto)
# After
assert type(current_proto) is type(new_proto)
  1. sdk/python/feast/api/registry/rest/rest_utils.pyvalidate_or_set_default_sorting_params(sort_by_options: List[str] = []) uses a mutable default argument (ruff B006). Changed to the Optional[...] = None sentinel. Behavior is unchanged: the inner dependency only ever checks truthiness (if not sort_by_options:), which treats None and [] identically.

Testing

No behavior change — python -m py_compile and ruff check --select E721,B006 pass on both files. The registry_diff.py change preserves the file's existing line endings.

🤖 Generated with Claude Code

@harshadkhetpal
harshadkhetpal requested a review from a team as a code owner August 15, 2026 14:33

@shuchu shuchu left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

lgtm

@ntkathole ntkathole changed the title fix: use identity check for type comparison and avoid mutable default argument fix: Use identity check for type comparison and avoid mutable default argument Aug 16, 2026
@ntkathole

Copy link
Copy Markdown
Member

@harshadkhetpal Please sign the commit to pass DCO

@harshadkhetpal
harshadkhetpal force-pushed the fix/type-identity-and-mutable-default branch from 49ba95f to e31ecfa Compare August 21, 2026 14:58
@harshadkhetpal

Copy link
Copy Markdown
Author

Gentle ping @ntkathole — this was approved by @shuchu a few weeks back and DCO is green; is there anything left on my side before it can land? Happy to rebase if the branch has drifted.

… argument

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Signed-off-by: Harshad Khetpal <harshadkhetpal@users.noreply.github.com>
@ntkathole
ntkathole force-pushed the fix/type-identity-and-mutable-default branch from e31ecfa to ddfdddd Compare September 17, 2026 04:04
@codecov-commenter

codecov-commenter commented Sep 17, 2026

Copy link
Copy Markdown

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

❌ Patch coverage is 0% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 47.19%. Comparing base (787845a) to head (ddfdddd).

Files with missing lines Patch % Lines
sdk/python/feast/diff/registry_diff.py 0.00% 1 Missing ⚠️
❗ Your organization needs to install the Codecov GitHub app to enable full functionality.
Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #6742   +/-   ##
=======================================
  Coverage   47.18%   47.19%           
=======================================
  Files         419      419           
  Lines       51964    51964           
  Branches     7548     7548           
=======================================
+ Hits        24521    24522    +1     
  Misses      25689    25689           
+ Partials     1754     1753    -1     
Flag Coverage Δ
go-feature-server 30.58% <ø> (ø)
python-unit 48.50% <0.00%> (+<0.01%) ⬆️
Files with missing lines Coverage Δ
sdk/python/feast/api/registry/rest/rest_utils.py 79.54% <ø> (ø)
sdk/python/feast/diff/registry_diff.py 49.40% <0.00%> (ø)

... and 1 file with indirect coverage changes


Continue to review full report in Codecov by Harness.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 787845a...ddfdddd. Read the comment docs.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants