fix: ODFV output projection in offline retrieval (#6099)#6140
Open
jyejare wants to merge 2 commits intofeast-dev:masterfrom
Open
fix: ODFV output projection in offline retrieval (#6099)#6140jyejare wants to merge 2 commits intofeast-dev:masterfrom
jyejare wants to merge 2 commits intofeast-dev:masterfrom
Conversation
6dc5107 to
a6bbfda
Compare
b114f3b to
f0bec1a
Compare
franciscojavierarceo
approved these changes
Mar 30, 2026
f0bec1a to
607b640
Compare
Member
|
@jyejare tests failing |
9789bd1 to
150d2fc
Compare
added 2 commits
April 1, 2026 21:53
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 <11752425+jyejare@users.noreply.github.com>
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 <11752425+jyejare@users.noreply.github.com>
150d2fc to
97a669e
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: