Conversation
With full_feature_names=True the requested ODFV refs are "<view>__<feature>", but transform_dict returns the UDF's short output names. Nothing matched, so python mode (batch and singleton) ODFV features were silently missing from get_online_features, while pandas mode worked because transform_arrow renames its outputs. Rename python mode outputs to the projected names, and look up the declared schema type under those names too. Signed-off-by: breken-ai <312387581+breken-ai@users.noreply.github.com>
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #6900 +/- ##
==========================================
+ Coverage 48.04% 48.06% +0.01%
==========================================
Files 427 427
Lines 53591 53596 +5
Branches 7800 7802 +2
==========================================
+ Hits 25749 25762 +13
+ Misses 25986 25982 -4
+ Partials 1856 1852 -4
... and 1 file with indirect coverage changes Continue to review full report in Codecov by Harness.
🚀 New features to boost your workflow:
|
| odfv_input_dict | ||
| ) | ||
| if full_feature_names: | ||
| # The UDF returns short output names, but the requested refs |
There was a problem hiding this comment.
Move the renaming into transform_dict by adding full_feature_names parameter. It makes the three transform methods consistent and prevents the bug from recurring if transform_dict gets called from anywhere else.
What this PR does / why we need it:
Online serving drops python mode on demand feature views when
full_feature_names=True.In
_augment_response_with_on_demand_transforms, a full-name request looks for"<view>__<feature>". The pandas path gets that name becausetransform_arrowrenames its outputs. The python path usestransform_dict, which returns the UDF's short output names. Nothing matches, soselected_subsetis empty and the feature disappears from the response. Batch andsingleton=Truepython ODFVs are both affected. A model client that asks for full names gets a KeyError or a silently missing input, and the same request in pandas mode works.The fix renames python mode outputs to
odfv._get_projected_feature_name(...)whenfull_feature_namesis set, which matches what_postprocess_arrow_tabledoes for pandas. The declared schema type is also looked up under the full name. Without that, full-name values fell back to type inference instead of the declared dtype.Which issue(s) this PR fixes:
No existing issue. I searched open issues and PRs for full_feature_names with python mode or ODFVs and didn't find a match.
Checks
git commit -s)Testing Strategy
New
test_python_views_with_full_feature_namesintests/unit/test_on_demand_python_transformation.py. It requests a pandas ODFV, a batch python ODFV and a singleton python ODFV withfull_feature_names=True.master(3667772) it fails: onlypandas_view__conv_rate_plus_acc_pandasis returned, and both python outputs are missing.TestOnDemandTransformationsWithWritestests hit the UDF globalsNameErrortracked in On-demand feature view UDFs lose their module globals when rebuilt from the registry, so serving fails with NameError #6815, and two tensor tests need torch.ruff check,ruff format --checkandmypy feast/utils.pyare clean.Misc
This change was prepared with an AI coding assistant, and the tests and checks above were run locally.