Skip to content

fix: Keep description, tags and nested types of ODFV schema fields - #7091

Open
Revinand wants to merge 1 commit into
feast-dev:masterfrom
Revinand:fix/odfv-field-description-inference
Open

Revinand wants to merge 1 commit into
feast-dev:masterfrom
Revinand:fix/odfv-field-description-inference

Conversation

@Revinand

Copy link
Copy Markdown

What this PR does / why we need it:

An on-demand feature view cannot have schema fields with a description or tags.

feast apply fails on such a view with SpecifiedFeaturesNotPresentError. _feature_exists_in_inferred checks specified_feature in inferred_features, which uses Field.__eq__ and compares the description, tags and vector settings. The inferred fields carry only a name and a type, and a scalar field with a description never matches. The check now compares the name and the type.

With only that change, feast apply succeeds, but the view read back from the registry has an empty description. _parse_features_from_proto builds each Field from the name, the value type and the vector settings instead of calling Field.from_proto, which FeatureView and StreamFeatureView use. Besides the description and tags, it loses the inner types of nested outputs:

Schema field type Type after OnDemandFeatureView.from_proto(odfv.to_proto()) on master
Struct({a: Int64}) Struct({_value: String})
Array(Array(Int64)) Array(Array(String))
Array(Struct({a: Int64})) Array(Struct({_value: String}))

_parse_features_from_proto now returns Field.from_proto(feature) for each feature.

To reproduce, add description="val plus one" to a Field in the schema of an @on_demand_feature_view with a RequestSource, in a repo with the local provider and the SQLite online store, and run feast apply. On master it stops after "Applying changes for project repro" with SpecifiedFeaturesNotPresentError. With this change it prints "Created on demand feature view plus_one", and store.get_on_demand_feature_view("plus_one").features[0].description is 'val plus one'.

Which issue(s) this PR fixes:

Fixes #3617. The stale bot closed it in 2025 without a fix. It reports the first half; the registry round-trip has no 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

Misc

test_schema_field_metadata_survives_inference_and_proto_round_trip in tests/unit/test_on_demand_feature_view.py checks that the description and tags survive infer_features, that a proto round-trip returns the original fields, including Struct and nested Array types, and that a wrong type still raises SpecifiedFeaturesNotPresentError. It fails on master. test_on_demand_feature_view.py and test_on_demand_python_transformation.py pass, and ruff is clean.

ODFVs that are already registered with Struct or nested outputs now load with their real inner types instead of _value: String.

@Revinand
Revinand requested a review from a team as a code owner October 29, 2026 21:46
@codecov-commenter

codecov-commenter commented Nov 1, 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 50.99%. Comparing base (1e5e90c) to head (e9a61b0).
⚠️ Report is 1 commits behind head on master.
❗ 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    #7091      +/-   ##
==========================================
+ Coverage   50.97%   50.99%   +0.01%     
==========================================
  Files         455      455              
  Lines       56994    56994              
  Branches     8321     8321              
==========================================
+ Hits        29055    29062       +7     
+ Misses      25954    25946       -8     
- Partials     1985     1986       +1     
Flag Coverage Δ
go-feature-server 30.58% <ø> (+0.20%) ⬆️
python-unit 52.45% <100.00%> (-0.01%) ⬇️
Files with missing lines Coverage Δ
sdk/python/feast/on_demand_feature_view.py 71.99% <100.00%> (ø)

... and 2 files 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 1e5e90c...e9a61b0. 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.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Defining an on_demand_feature_view fails if fields have descriptions

2 participants