Skip to content

fix: Return feature_view_metadata from the REST feature server - #6927

Merged
ntkathole merged 2 commits into
feast-dev:masterfrom
Zhuoxi2000:fix-rest-drops-fv-version-metadata
Oct 2, 2026
Merged

ntkathole merged 2 commits into
feast-dev:masterfrom
Zhuoxi2000:fix-rest-drops-fv-version-metadata

Conversation

@Zhuoxi2000

Copy link
Copy Markdown
Contributor

What this PR does / why we need it:

GetOnlineFeaturesRequest and GetOnlineDocumentsRequest accept include_feature_view_version_metadata, and the feature server passes it on to the store. The store fills metadata.feature_view_metadata on the response proto. The REST layer then dropped the field, so over HTTP the flag had no effect.

This PR fixes all three places where the field was lost:

  • feast/feature_server_utils.py: _metadata_to_dict now emits feature_view_metadata when it is non-empty. It uses the same shape as MessageToDict(preserving_proto_field_name=True), so a default name/version is omitted, as the module docstring promises. When the flag is not set, the output is unchanged.
  • feast/feature_server.py: adds FeatureViewMetadataResponse and a feature_view_metadata field to OnlineFeaturesMetadataResponse, so the OpenAPI schema documents what the endpoint returns.
  • feast/infra/online_stores/remote.py: _build_online_response_from_json parses feature_view_metadata back into the proto. A client that uses RemoteOnlineStore with include_feature_view_version_metadata=True already sends the flag, and now gets the metadata back.

The flag was added in #6101. The response model from #6142 already filtered the field out, and #6015 then dropped it from the custom dict builder, so it has never come back over REST.

Which issue(s) this PR fixes:

Fixes #6922

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

  • test_feature_server_utils.py::TestFeatureViewVersionMetadata: checks that convert_response_to_dict matches MessageToDict for feature_view_metadata (version 2 and version 0), and that the key is absent when the metadata was not requested.
  • test_feature_server.py::test_get_online_features_returns_feature_view_version_metadata: pushes rows, then calls POST /get-online-features with the flag and checks the field is in the response.
  • test_remote_online_store.py::test_build_online_response_feature_view_metadata: checks that RemoteOnlineStore round-trips the field into the proto.
cd sdk/python
python -m pytest tests/unit/test_feature_server_utils.py tests/unit/test_feature_server.py \
  tests/unit/infra/online_store/test_remote_online_store.py \
  -k 'FeatureViewVersionMetadata or version_metadata or feature_view_metadata'
  • Before (master @ 810391f with only the tests applied): 4 failed, 2 passed.
  • After: 6 passed.

All three test files: 126 passed. ruff check and ruff format --check (ruff 0.16.9) pass on the changed files. mypy adds no new errors.

Misc

The remote.py change is limited to the response-parsing helper. It should not conflict with the open PRs that touch the request and write paths of RemoteOnlineStore.

AI assistance: this change was drafted with an AI coding assistant (Claude) and verified locally with the tests above.

When a request sets include_feature_view_version_metadata, the store fills
metadata.feature_view_metadata on the response proto, but the REST layer
dropped it: _metadata_to_dict only emitted feature_names, and the
OnlineFeaturesMetadataResponse model had no field for it. The flag was
therefore a no-op over HTTP.

Emit feature_view_metadata in _metadata_to_dict in the same shape as
MessageToDict(preserving_proto_field_name=True), declare it on the
response model, and parse it back in RemoteOnlineStore so versioned reads
through a remote online store keep the metadata.

Signed-off-by: Edson <zhuoxi2000@gmail.com>
@Zhuoxi2000
Zhuoxi2000 requested a review from a team as a code owner October 1, 2026 23:53
@codecov-commenter

codecov-commenter commented Oct 2, 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 95.00000% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 48.64%. Comparing base (652b7f9) to head (cfae311).

Files with missing lines Patch % Lines
sdk/python/feast/feature_server_utils.py 90.00% 0 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    #6927      +/-   ##
==========================================
+ Coverage   48.62%   48.64%   +0.02%     
==========================================
  Files         427      427              
  Lines       53845    53864      +19     
  Branches     7844     7849       +5     
==========================================
+ Hits        26181    26204      +23     
+ Misses      25797    25792       -5     
- Partials     1867     1868       +1     
Flag Coverage Δ
go-feature-server 30.58% <ø> (ø)
python-unit 50.02% <95.00%> (+0.02%) ⬆️
Files with missing lines Coverage Δ
sdk/python/feast/feature_server.py 64.08% <100.00%> (+0.19%) ⬆️
sdk/python/feast/infra/online_stores/remote.py 64.39% <100.00%> (+0.53%) ⬆️
sdk/python/feast/feature_server_utils.py 88.73% <90.00%> (+0.20%) ⬆️

... 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 652b7f9...cfae311. 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.

@haoxu0 haoxu0 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

LGTM

@ntkathole
ntkathole merged commit bc5aeef into feast-dev:master Oct 2, 2026
26 of 28 checks passed
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.

REST feature server drops feature_view_metadata when include_feature_view_version_metadata is set

4 participants