fix: ODFV output projection in offline retrieval (#6099)#6140
Open
jyejare wants to merge 1 commit intofeast-dev:masterfrom
Open
fix: ODFV output projection in offline retrieval (#6099)#6140jyejare wants to merge 1 commit intofeast-dev:masterfrom
jyejare wants to merge 1 commit intofeast-dev:masterfrom
Conversation
|
|
||
| if metadata and metadata.features: | ||
| for feature_ref in metadata.features: | ||
| if ":" in feature_ref: |
Member
There was a problem hiding this comment.
this is going to be brittle after my feature view version PR lands as feature references will now support @vN syntax.
Collaborator
Author
There was a problem hiding this comment.
@franciscojavierarceo How would it look like once implemented so that I can make it future proof OR would you like to handle in your PR ?
Collaborator
Author
There was a problem hiding this comment.
Ahh I see! It may look like driver_stats@v2:trips_today but I dont see this syntax will break identifying view_name and feature_name. Because separator would still remain same :.
Collaborator
Author
There was a problem hiding this comment.
6dc5107 to
a6bbfda
Compare
Changes: - Modified RetrievalJob.to_arrow() to filter ODFV outputs based on requested features from metadata, matching online retrieval behavior - Added test_odfv_projection to verify the fix and prevent regression Before this fix: - Online: features=['odfv:feature_a'] -> returns feature_a only ✓ - Offline: features=['odfv:feature_a'] -> returns feature_a, feature_b, feature_c ✗ After this fix: - Both online and offline return only the requested features ✓ This ensures schema consistency between training (offline) and serving (online) pipelines, preventing downstream issues in ML workflows. Fixes feast-dev#6099 Signed-off-by: Jitendra Yejare <[email protected]>
a6bbfda to
266a37d
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.
Summary
Fixes #6099 - Ensures offline retrieval honors ODFV feature projection, matching online retrieval behavior.
Problem
When requesting a subset of features from an OnDemandFeatureView:
This caused schema mismatches between training and serving pipelines.
Solution
Modified
RetrievalJob.to_arrow()inoffline_store.pyto:metadata.featuresExample
Before this fix:
After this fix:
Changes
Modified:
sdk/python/feast/infra/offline_stores/offline_store.pyRetrievalJob.to_arrow()method (lines 140-184)Added: Test in
sdk/python/tests/integration/offline_store/test_universal_historical_retrieval.pytest_odfv_projection()- Comprehensive test verifying:full_feature_names=TrueandFalseTesting
The new test
test_odfv_projectionverifies:Backward Compatibility
Impact
This fix ensures: