Visitar URL original
fix: Return python mode ODFV features with full feature names by breken-ai · Pull Request #6900 · feast-dev/feast · GitHub
Skip to content

fix: Return python mode ODFV features with full feature names - #6900

Open
breken-ai wants to merge 2 commits into
feast-dev:masterfrom
breken-ai:fix/python-odfv-full-feature-names
Open

breken-ai wants to merge 2 commits into
feast-dev:masterfrom
breken-ai:fix/python-odfv-full-feature-names

Conversation

@breken-ai

@breken-ai breken-ai commented Sep 30, 2026 •

Copy link
Copy Markdown
Contributor

What this PR does / why we need it:

Online serving drops python mode on demand feature views when full_feature_names=True.

store.get_online_features(
    entity_rows=[{"driver_id": 1001}],
    features=["driver_hourly_stats:conv_rate", "python_view:conv_rate_plus_acc"],
    full_feature_names=True,
)
# -> {"driver_id": [...], "driver_hourly_stats__conv_rate": [...]}
#    python_view__conv_rate_plus_acc is missing, no error raised

In _augment_response_with_on_demand_transforms, a full-name request looks for "<view>__<feature>". The pandas path gets that name because transform_arrow renames its outputs. The python path uses transform_dict, which returns the UDF's short output names. Nothing matches, so selected_subset is empty and the feature disappears from the response. Batch and singleton=True python 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 adds a full_feature_names parameter to OnDemandFeatureView.transform_dict, as suggested in review. A new _postprocess_feature_dict renames outputs the same way _postprocess_arrow_table does, so transform_dict, transform_arrow and transform_ibis all name their outputs consistently for any caller. The online path passes full_feature_names through. 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.

This PR also adds the alias + python mode + full_feature_names coverage requested by @ntkathole on #6901.

Checks

  • I've made sure the tests are passing.
  • My commits are signed off (git commit -s)
  • My PR title follows conventional commits format

Testing Strategy

  • Unit tests
  • Integration tests
  • Manual tests
  • Testing is not required for this change

Branch rebased on master @ 9d42729 (includes #6901).

  • test_python_views_with_full_feature_names (test_on_demand_python_transformation.py): requests a pandas ODFV, a batch python ODFV and a singleton python ODFV with full_feature_names=True. On the original base (3667772), only pandas_view__conv_rate_plus_acc_pandas came back and both python outputs were missing. Passes with this change. The aliased test below shows the same python mode gap on current master @ 9d42729.
  • test_feature_service_serves_aliased_odfv_features[pandas|python|python_singleton] (test_on_demand_pandas_transformation.py): an ODFV added to a feature service with with_name("scaled_alias"), served with default and full names, so this covers alias + python mode + full_feature_names together.
  • test_transform_dict_full_feature_names[batch|singleton]: calls transform_dict directly and checks short names by default, plus_one__val_plus_one with full_feature_names=True, and alias__val_plus_one after with_name("alias"). It fails against the first revision of this PR (TypeError: transform_dict() got an unexpected keyword argument 'full_feature_names') and passes now.
  • Across the ODFV, transformation, feature service, online response, versioning, utils and feature store unit files, this branch gives 184 passed and master gives 180. Both have the same 7 failures and 7 collection errors locally: missing torch, the TestOnDemandTransformationsWithWrites UDF globals NameError tracked in On-demand feature view UDFs lose their module globals when rebuilt from the registry, so serving fails with NameError #6815, two serve_registry tests, and two modules that need deps not installed here.
  • ruff check, ruff format --check and mypy feast/on_demand_feature_view.py feast/utils.py are clean.

Misc

This change was prepared with an AI coding assistant, and the tests and checks above were run locally.

@codecov-commenter

codecov-commenter commented Sep 30, 2026 •

Copy link
Copy Markdown

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

❌ Patch coverage is 84.61538% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 49.33%. Comparing base (9d42729) to head (6976dbb).

Files with missing lines Patch % Lines
sdk/python/feast/on_demand_feature_view.py 81.81% 1 Missing and 1 partial ⚠️
❗ Your organization needs to install the Codecov GitHub app to enable full functionality.
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #6900      +/-   ##
==========================================
+ Coverage   49.32%   49.33%   +0.01%     
==========================================
  Files         443      443              
  Lines       55094    55106      +12     
  Branches     8017     8021       +4     
==========================================
+ Hits        27176    27189      +13     
+ Misses      26035    26034       -1     
  Partials     1883     1883              
Flag Coverage Δ
go-feature-server 30.58% <ø> (ø)
python-unit 50.73% <84.61%> (+0.01%) ⬆️
Files with missing lines Coverage Δ
sdk/python/feast/utils.py 81.74% <100.00%> (+0.04%) ⬆️
sdk/python/feast/on_demand_feature_view.py 72.66% <81.81%> (+0.67%) ⬆️

Continue to review full report in Codecov by Harness.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 9d42729...6976dbb. Read the comment docs.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Comment thread sdk/python/feast/utils.py Outdated
odfv_input_dict
)
if full_feature_names:
# The UDF returns short output names, but the requested refs

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

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>
Move the full feature name renaming out of
_augment_response_with_on_demand_transforms and into
OnDemandFeatureView.transform_dict, behind a new full_feature_names
parameter, as suggested in review. It mirrors _postprocess_arrow_table,
so transform_dict, transform_arrow and transform_ibis name their outputs
the same way for any caller.

Also cover alias + python mode + full_feature_names together: the
aliased feature service test now checks "<alias>__<feature>" in pandas,
python and singleton python modes, and a unit test checks transform_dict
naming directly, with and without an alias.

Signed-off-by: breken-ai <312387581+breken-ai@users.noreply.github.com>
@breken-ai
breken-ai force-pushed the fix/python-odfv-full-feature-names branch from 390856c to 6976dbb Compare October 8, 2026 00:18

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants