fix: Serve aliased on demand feature views in feature services - #6901
Conversation
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #6901 +/- ##
=======================================
Coverage 48.04% 48.05%
=======================================
Files 427 427
Lines 53591 53591
Branches 7800 7800
=======================================
+ Hits 25749 25753 +4
+ Misses 25986 25984 -2
+ Partials 1856 1854 -2
... and 2 files with indirect coverage changes Continue to review full report in Codecov by Harness.
🚀 New features to boost your workflow:
|
|
Thanks @breken-ai for fixes, may be once both pr merged or in one of the pr you can add test coverage for alias + python mode + full_feature_names to make sure no regressions |
933b68c to
3829d87
Compare
An ODFV added to a FeatureService with with_name() produces feature refs under the alias, but the online transform lookup was keyed by the ODFV's registered name. The transform was skipped and its features were silently missing from get_online_features responses. Key the lookup by the projection alias when one is set. Signed-off-by: breken-ai <312387581+breken-ai@users.noreply.github.com>
3829d87 to
95a4ef6
Compare
What this PR does / why we need it:
If an on demand feature view is added to a
FeatureServiceunder an alias, its features are silently missing from online responses.The feature service's refs use the projection name, so they read
scaled_alias:conv_rate_x10._group_feature_refsand_get_feature_views_to_useresolve that ref throughprojection.name_to_use()._augment_response_with_on_demand_transformsis different: it keysrequested_odfv_mapbyodfv.name, which isscaled. The aliased ref never matches, the transform is skipped, and the requested feature is dropped from the response. Pandas and python modes are both affected.with_nameis the public aliasing API for ODFVs (#1872), and the same function already builds full names fromprojection.name_to_use(), so aliases are meant to work here. The fix keys the map byprojection.name_aliaswhen one is set and falls back toodfv.name. Versioned refs are unchanged, because_parse_feature_refstrips@vNbefore the lookup.Which issue(s) this PR fixes:
No existing issue. I searched open issues and PRs for ODFV aliases and
with_namein feature services and didn't find a match.Checks
git commit -s)Testing Strategy
New
test_feature_service_serves_aliased_odfv_features[pandas|python]intests/unit/test_on_demand_pandas_transformation.py. It serves a feature service that holdsodfv.with_name(...)and checks the default names in both modes and the full names (scaled_alias__conv_rate_x10) in pandas mode.master(3667772) both cases fail withKeyError: 'conv_rate_x10'.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 PR only fixes online serving.
get_historical_featureswith the same aliased feature service fails loudly withCould not find feature view from reference scaled_alias:conv_rate_x10, because offline stores re-fetch ODFVs from the registry by name. That is part of the ODFV handling cleanup in #5890.The python mode full-name case is fixed separately in #6900.
This change was prepared with an AI coding assistant, and the tests and checks above were run locally.