fix: ODFV output projection in offline retrieval (#6099)#6140
fix: ODFV output projection in offline retrieval (#6099)#6140ntkathole merged 1 commit intofeast-dev:masterfrom
Conversation
6dc5107 to
a6bbfda
Compare
b114f3b to
f0bec1a
Compare
f0bec1a to
607b640
Compare
|
@jyejare tests failing |
97a669e to
469cfbb
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 Signed-off-by: Jitendra Yejare <11752425+jyejare@users.noreply.github.com>
469cfbb to
f9a2751
Compare
There was a problem hiding this comment.
🟡 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.
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: