fix: Return feature_view_metadata from the REST feature server - #6927
Merged
ntkathole merged 2 commits intoOct 2, 2026
Merged
Conversation
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>
|
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ 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
... and 1 file with indirect coverage changes Continue to review full report in Codecov by Harness.
🚀 New features to boost your workflow:
|
ntkathole
approved these changes
Oct 2, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What this PR does / why we need it:
GetOnlineFeaturesRequestandGetOnlineDocumentsRequestacceptinclude_feature_view_version_metadata, and the feature server passes it on to the store. The store fillsmetadata.feature_view_metadataon 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_dictnow emitsfeature_view_metadatawhen it is non-empty. It uses the same shape asMessageToDict(preserving_proto_field_name=True), so a defaultname/versionis omitted, as the module docstring promises. When the flag is not set, the output is unchanged.feast/feature_server.py: addsFeatureViewMetadataResponseand afeature_view_metadatafield toOnlineFeaturesMetadataResponse, so the OpenAPI schema documents what the endpoint returns.feast/infra/online_stores/remote.py:_build_online_response_from_jsonparsesfeature_view_metadataback into the proto. A client that usesRemoteOnlineStorewithinclude_feature_view_version_metadata=Truealready 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
git commit -s)Testing Strategy
New tests:
test_feature_server_utils.py::TestFeatureViewVersionMetadata: checks thatconvert_response_to_dictmatchesMessageToDictforfeature_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 callsPOST /get-online-featureswith the flag and checks the field is in the response.test_remote_online_store.py::test_build_online_response_feature_view_metadata: checks thatRemoteOnlineStoreround-trips the field into the proto.All three test files: 126 passed.
ruff checkandruff format --check(ruff 0.16.9) pass on the changed files.mypyadds no new errors.Misc
The
remote.pychange is limited to the response-parsing helper. It should not conflict with the open PRs that touch the request and write paths ofRemoteOnlineStore.AI assistance: this change was drafted with an AI coding assistant (Claude) and verified locally with the tests above.