Repository navigation
fix: Stop feast plan and apply raising on a changed BatchFeatureView - #7042
Open
spicysharkco wants to merge 1 commit into
Open
spicysharkco wants to merge 1 commit into
spicysharkco wants to merge 1 commit into
Conversation
diff_registry_objects treated every changed feature_transformation as belonging to an on demand feature view and read the deprecated top-level user_defined_function field of the spec. FeatureViewSpec has no such field, so feast plan raised ValueError for a BatchFeatureView with a transformation as soon as anything in it differed from the registry. feast apply raised the same way when it ran the plan first (local provider, SQLite online store). Read the deprecated field only when the spec has it. Signed-off-by: spicysharkco <321699413+spicysharkco@users.noreply.github.com>
This branch has not been deployed
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.
What this PR does / why we need it:
feast planraises for a@batch_feature_viewwith a transformation as soon as anything in it differs from the registry.feast applyraises too: with the defaultlocalprovider and SQLite online store it runs the same plan first. To reproduce, apply such a repo withtags={"team": "a"}, change the tag to"b"and runfeast plan:With this change
feast planprints the diff andfeast applygoes through.Cause:
diff_registry_objectscallsHasField("user_defined_function")on every spec whosefeature_transformationchanged. That deprecated field exists onOnDemandFeatureViewSpecandStreamFeatureViewSpec, not onFeatureViewSpec. A view read back from the registry never carries the declared transformation bytes, so any change to the view reaches this branch.The fix reads the field only when the spec has it (
hasattr, ason_demand_feature_view.pydoes). On demand views behave as before. Not covered here: a change to only the function body of a batch view is still not detected, because the view's__eq__ignores the transformation.Which issue(s) this PR fixes:
No issue, found while checking
feast plandiffs.Checks
git commit -s)Testing Strategy
Added
test_diff_batch_feature_view_with_transformationnext totest_diff_odfvinsdk/python/tests/unit/diff/test_registry_diff.py. It diffs a view read back from its proto against a changed declaration: a tags change reports onlytags, and a tags plus function text change reportstagsandfeature_transformation.body_text. It fails on master with theValueErrorabove and passes with the fix:pytest sdk/python/tests/unit/diff/test_registry_diff.py -k test_diff_batch_feature_view_with_transformationgives 1 passed, the whole file 6 passed.ruff checkandruff format --checkare clean on both files.