Skip to content

fix: Return on demand features with full feature names and over Python gRPC - #7236

Open
patelchaitany wants to merge 4 commits into
feast-dev:masterfrom
patelchaitany:fix/odfv-online-retrieval
Open

patelchaitany wants to merge 4 commits into
feast-dev:masterfrom
patelchaitany:fix/odfv-online-retrieval

Conversation

@patelchaitany

@patelchaitany patelchaitany commented Nov 25, 2026 •

Copy link
Copy Markdown
Contributor

What this PR does / why we need it:

Two bugs in online retrieval for on demand feature views. Each fix is its own commit, plus a third that keeps declared types with full feature names.

1. Python-mode features are dropped with full_feature_names=True

A Python-mode on demand feature view returns none of its features when full_feature_names=True. They are dropped from the response, with no error.

Why. Online retrieval asks for an on demand feature as <view>__<feature>. Pandas mode renames the UDF's outputs to that form in transform_arrow. Python mode uses transform_dict, which kept the bare names (greeting), so nothing matched the request.

Fix. transform_dict now takes the same full_feature_names argument and renames outputs the way transform_arrow does. Online retrieval (_augment_response_with_on_demand_transforms in utils.py), its only caller, passes the flag through. Python mode now returns greeting_view__greeting, the same as pandas mode. With the flag off, nothing changes.

Declared types. Online retrieval selected an output by its long name but looked up its declared type by the bare name. The lookup missed, so the values were converted with an inferred type: a batch of empty arrays raised Couldn't infer value type from empty value, and Python floats in an Array(Float32) came back as a double list. The type lookup in _augment_response_with_on_demand_transforms now uses the same name as the output selection.

2. The Python gRPC server fails for views with request fields

Every request to the Python gRPC feature server fails for an on demand feature view that reads a request source:

Value with native type value cannot be converted into Feast value type

Why. The gRPC server passes a request's entities to get_online_features as proto Values, which get_online_features accepts. Join keys work because their type is known, and proto Values pass straight through. Request fields have no declared type, so Feast infers one from the first value, and python_type_to_feast_value_type cannot infer a type from a proto Value.

Fix. In python_values_to_proto_values (type_map.py), when the type is unknown and the values are already proto Values, take the type from the field the proto sets. The values then pass through unchanged. This also fixes SDK callers who pass RepeatedValues, not only gRPC.

Which issue(s) this PR fixes:

No GitHub issue.

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

One test, test_python_view_with_full_feature_names in tests/unit/test_on_demand_python_transformation.py, covers all three fixes. A Python-mode view with an Array(Float32) output is read with full_feature_names=True, its request data is passed as a proto Value (as the gRPC server does), and it returns an empty list. Without any one of the fixes it fails: KeyError without the naming fix, Value with native type value cannot be converted without the proto value fix, and Couldn't infer value type from empty value without the type fix.

The on demand feature view, type map and feature server unit suites pass. In a wider run, test_milvus_native_from_feast_data crashed inside milvus_lite's faiss index build on my machine, with or without these changes. ruff and mypy are clean.

Manually, against a local repo: Python mode returned greeting_view__greeting with full_feature_names=True, matching pandas mode, and a real gRPC call to the Python feature server returned greeting: "Hi Alice (s1)" for a view with a request source, in both Python and pandas mode.


Devin Review

…sted

With full_feature_names=True, online retrieval asks for an on demand
feature as "<view>__<feature>". Pandas mode renames the UDF's outputs to
that form in transform_arrow, but transform_dict, used by Python mode,
returned them under their bare names, so none matched the request and
the features were dropped from the response without an error.

Give transform_dict the same full_feature_names argument and output
renaming as transform_arrow, and pass it from online retrieval.

Signed-off-by: Chaitany Patel <patelchaitany93@gmail.com>
get_online_features takes entity values as proto Values, which is how
the Python gRPC feature server passes a request's RepeatedValue map.
Join keys convert because their type is known and proto Values pass
through, but request data for an on demand feature view has no declared
type, and inferring one from a proto Value raised "Value with native
type value cannot be converted into Feast value type". Every gRPC
request for an on demand feature view with a request source failed.

When the type is unknown and the values are already proto Values, take
the type from the field the proto sets and pass the values through.

Signed-off-by: Chaitany Patel <patelchaitany93@gmail.com>
@patelchaitany
patelchaitany requested a review from a team as a code owner November 25, 2026 06:26

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Devin Review found 2 potential issues.

3 flags not posted on this PR by your GitHub settings — view them in Devin Review. (Configure)

Devin Review

Comment thread sdk/python/feast/type_map.py Resolved
Comment thread sdk/python/feast/utils.py Resolved
@codecov-commenter

codecov-commenter commented Nov 25, 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 81.81818% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 54.11%. Comparing base (a291a0f) to head (efa8dc8).

Files with missing lines Patch % Lines
sdk/python/feast/on_demand_feature_view.py 71.42% 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    #7236   +/-   ##
=======================================
  Coverage   54.10%   54.11%           
=======================================
  Files         467      467           
  Lines       58940    58949    +9     
  Branches     8688     8692    +4     
=======================================
+ Hits        31890    31899    +9     
+ Misses      24892    24889    -3     
- Partials     2158     2161    +3     
Flag Coverage Δ
go-feature-server 30.96% <ø> (ø)
python-unit 55.71% <81.81%> (+<0.01%) ⬆️
Files with missing lines Coverage Δ
sdk/python/feast/type_map.py 68.43% <100.00%> (+0.54%) ⬆️
sdk/python/feast/utils.py 82.94% <100.00%> (-0.12%) ⬇️
sdk/python/feast/on_demand_feature_view.py 71.98% <71.42%> (-0.01%) ⬇️

... 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 a291a0f...efa8dc8. 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.

With full_feature_names=True, online retrieval selects an on demand
feature by its "<view>__<feature>" name, but looked up its declared type
by the bare name. The lookup missed, so the values were converted with
an inferred type: a batch of empty arrays raised "Couldn't infer value
type from empty value", and Python floats in an Array(Float32) came back
as a double list.

Key the type lookup by the same name used to select the output.

Signed-off-by: Chaitany Patel <patelchaitany93@gmail.com>
Replace the three tests with one: a Python-mode view with an
Array(Float32) output, read with full feature names, with its request
data passed as a proto Value, returning an empty list. It fails without
any one of the three fixes.

Signed-off-by: Chaitany Patel <patelchaitany93@gmail.com>

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.

3 participants