Repository navigation
fix: Update the LabelView source when it is re-applied - #7211
ShivamSharma43 wants to merge 1 commit into
Conversation
Registry._update_metadata_fields copies batch_source and stream_source, but LabelViewSpec keeps its data source in source. Re-applying a LabelView with a new source and the same schema left the old source in the registry. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Shivam Sharma <192242476+ShivamSharma43@users.noreply.github.com>
There was a problem hiding this comment.
Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.
An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing.
There was a problem hiding this comment.
🔍 Devin Review: 3 flags
Not posted on this PR by your GitHub settings — view them in Devin Review. (Configure)
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #7211 +/- ##
==========================================
+ Coverage 53.67% 53.71% +0.03%
==========================================
Files 462 462
Lines 58549 58555 +6
Branches 8634 8636 +2
==========================================
+ Hits 31424 31450 +26
+ Misses 24988 24978 -10
+ Partials 2137 2127 -10
... and 1 file with indirect coverage changes Continue to review full report in Codecov by Harness.
🚀 New features to boost your workflow:
|
What this PR does / why we need it:
Re-applying a
LabelViewwith a new data source and the same schema keeps the old source in the file-based registries. No error is raised.When the schema is unchanged,
Registry.apply_feature_viewupdates the stored proto in place through_update_metadata_fields. That method treats data sources as configuration, but it only copiesbatch_sourceandstream_source.LabelViewSpechas neither; it keeps its source insource, so the change is dropped. The SQL registry stores the whole new proto, so it isn't affected._update_metadata_fieldsnow also copiessourcefor aLabelView, and clears it when the new view has no source (sourceis optional there). It serializes the source withserialize_data_source, asLabelView.to_protodoes.Which issue(s) this PR fixes:
No issue filed; found while reading the registry code.
Checks
git commit -s)Testing Strategy
Unit tests
Integration tests
Manual tests
Testing is not required for this change
New tests in
sdk/python/tests/unit/infra/registry/test_update_metadata_fields.pycover a changedFileSource, a changedPushSourceand a removed source. All three cases fail on master and pass with the fix.Applying a LabelView twice to a file registry, with
file://old/*and thenfile://new/*, returns the old path on master and the new one with the fix.test_update_metadata_fields.py,test_registry.py,test_file_registry.pyandtest_label_view.py: 52 passed. The two tests intest_file_registry.pyalso report a teardown error on Windows (temp directory still in use), the same on master. The rest of the registry unit tests and the integration tests were not run locally.ruff checkandruff formatare clean.mypy feast/infra/registry/registry.pyreports one error, the same as on master.Misc
This change was prepared with AI assistance (Claude Code), which also ran the tests listed above.
🤖 Generated with Claude Code