Skip to content

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

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

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

Conversation

@breken-ai

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 renames python mode outputs to odfv._get_projected_feature_name(...) when full_feature_names is set, which matches what _postprocess_arrow_table does 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

  • 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

New test_python_views_with_full_feature_names in tests/unit/test_on_demand_python_transformation.py. It requests a pandas ODFV, a batch python ODFV and a singleton python ODFV with full_feature_names=True.

Misc

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

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-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

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 48.06%. Comparing base (3667772) to head (390856c).
❗ 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   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     
Flag Coverage Δ
go-feature-server 30.58% <ø> (ø)
python-unit 49.40% <100.00%> (+0.02%) ⬆️
Files with missing lines Coverage Δ
sdk/python/feast/utils.py 79.66% <100.00%> (+0.26%) ⬆️

... and 1 file with indirect coverage changes


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 3667772...390856c. 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
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.

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