GeezerVison is showing github.com — fix: ODFV output projection in offline retrieval (#6099) by jyejare · Pull Request #6140 · feast-dev/feast
Conversation
jyejare
commented
Mar 23, 2026
•
edited by devin-ai-integration
Bot
Loading
Uh oh!
There was an error while loading. Please reload this page.
Summary
Fixes #6099 - Ensures offline retrieval honors ODFV feature projection, matching online retrieval behavior.
Problem
When requesting a subset of features from an OnDemandFeatureView:
- Online retrieval ✅ Returns only requested features
- Offline retrieval ❌ Returns ALL ODFV output features (before this fix)
This caused schema mismatches between training and serving pipelines.
Solution
Modified RetrievalJob.to_arrow() in offline_store.py to:
- Parse requested features from
metadata.features
- Build a mapping of ODFV name → requested feature names
- Filter ODFV transformation output to only include requested columns
Example
Before this fix:
features = ["my_odfv:feature_a"]
offline_result = store.get_historical_features(features=features, ...)
# Columns: driver_id, event_timestamp, feature_a, feature_b, feature_c ❌
After this fix:
features = ["my_odfv:feature_a"]
offline_result = store.get_historical_features(features=features, ...)
# Columns: driver_id, event_timestamp, feature_a ✅
Changes
Modified: sdk/python/feast/infra/offline_stores/offline_store.py
- Updated
RetrievalJob.to_arrow() method (lines 140-184)
- Added filtering logic for ODFV output projection
- Maintains backward compatibility
Added: Test in sdk/python/tests/integration/offline_store/test_universal_historical_retrieval.py
test_odfv_projection() - Comprehensive test verifying:
- Single feature request returns only that feature
- Multiple feature request returns only requested features
- Unrequested features are NOT included
- Offline and online retrieval have consistent behavior
- Parametrized for both
full_feature_names=True and False
Testing
The new test test_odfv_projection verifies:
- ✅ Requesting 1 out of 3 ODFV features → returns only that 1 feature
- ✅ Requesting 2 out of 3 ODFV features → returns only those 2 features
- ✅ Unrequested features are NOT included in the result
- ✅ Offline and online retrieval return consistent schemas
Backward Compatibility
- ✅ Falls back to old behavior if metadata is unavailable
- ✅ No breaking changes to existing functionality
- ✅ Only affects ODFV feature projection
Impact
This fix ensures:
- ✅ Consistent behavior between online and offline retrieval
- ✅ No schema mismatches in ML pipelines
- ✅ More efficient - doesn't compute/return unnecessary features
- ✅ Matches user expectations - returns exactly what was requested
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
jyejare
changed the title
Fix ODFV output projection in offline retrieval (#6099)
fix: ODFV output projection in offline retrieval (#6099)
Mar 23, 2026
This comment was marked as resolved.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
This comment was marked as resolved.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
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
Signed-off-by: Jitendra Yejare <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Devin Review found 1 new potential issue.
View 15 additional findings in Devin Review.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🟡 Feature name collision validation bypassed for implicitly-added ODFV dependency refs
_validate_feature_refs at sdk/python/feast/feature_store.py:1476 is called with _feature_refs (the user's original refs), but the provider receives _feature_refs_for_provider which includes additional dependency FV refs added at lines 1454-1461. If full_feature_names=False and an ODFV dependency feature has the same name as a user-requested feature from a different FV (e.g., user requests fv1:conv_rate and the ODFV depends on fv2:conv_rate), the collision is not detected by validation, and both features produce identically-named output columns, leading to data corruption or errors in the offline store's point-in-time join.
(Refers to line 1476)
Was this helpful? React with 👍 or 👎 to provide feedback.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Assignees
No one assigned
Milestone
No milestone
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.
|