Repository navigation
REST feature server drops feature_view_metadata when include_feature_view_version_metadata is set #6922
Description
Expected Behavior
POST /get-online-features (and /search / /retrieve-online-documents with api_version: 2) accepts include_feature_view_version_metadata: true. With that flag set, the response metadata should contain feature_view_metadata, a list of {name, version} entries, like the Python SDK and gRPC paths return. Three things support this:
ServingService.proto:repeated FeatureViewMetadata feature_view_metadata = 2; // Only populated when requested.- The
feast/feature_server_utils.pydocstring saysconvert_response_to_dictmatchesMessageToDict(proto, preserving_proto_field_name=True). The only exception it documents isdouble_valprecision.MessageToDictdoes emitfeature_view_metadata. RemoteOnlineStoresends the flag to the server, and its unit test says it does so "so versioned reads work end-to-end".
Current Behavior
The flag reaches store.get_online_features(...), and metadata.feature_view_metadata is filled on the response proto. It is then dropped during JSON serialization. The HTTP response metadata only ever contains feature_names, so over REST the flag has no effect.
The field is lost in three places:
feature_server_utils._metadata_to_dictonly readsmetadata.feature_names.OnlineFeaturesMetadataResponseinfeature_server.pyhas nofeature_view_metadatafield. Before perf: Replace MessageToDict with optimized custom dict builder #6015, the endpoint returned a dict throughresponse_model=OnlineFeaturesResponse, so this model already filtered the field out. In practice the field has not been returned over REST since the flag was added in feat: Add version tracking to FeatureView #6101.RemoteOnlineStore._build_online_response_from_json(infra/online_stores/remote.py) rebuilds the metadata fromfeature_namesonly. Even if the server returned the field, a client using a remote online store would still lose it.
Steps to reproduce
Minimal, no server needed (master @ 810391f):
from google.protobuf.json_format import MessageToDict
from feast import proto_json
from feast.feature_server_utils import convert_response_to_dict
from feast.protos.feast.serving.ServingService_pb2 import GetOnlineFeaturesResponse
proto_json.patch()
r = GetOnlineFeaturesResponse()
r.metadata.feature_names.val.append("trips_today")
r.metadata.feature_view_metadata.add(name="driver_stats", version=2)
print(convert_response_to_dict(r)["metadata"])
# {'feature_names': ['trips_today']}
print(MessageToDict(r, preserving_proto_field_name=True)["metadata"])
# {'feature_names': ['trips_today'], 'feature_view_metadata': [{'name': 'driver_stats', 'version': 2}]}End to end, with feast serve on any repo. The PR's test_get_online_features_returns_feature_view_version_metadata checks the same thing through the FastAPI test client:
curl -s -X POST localhost:6566/get-online-features -H 'Content-Type: application/json' -d '{
"features": ["driver_hourly_stats:conv_rate"],
"entities": {"driver_id": [1001]},
"include_feature_view_version_metadata": true
}' | jq .metadata
# {"feature_names": ["driver_id", "conv_rate"]} <- no feature_view_metadataSpecifications
- Version: master (810391f), 0.66.x dev
- Platform: macOS 26.5 arm64, Python 3.11 (not platform specific)
- Subsystem: Python feature server (REST), remote online store
Possible Solution
- In
_metadata_to_dict, emitfeature_view_metadatawhen it is non-empty, in the same shapeMessageToDictuses (default-valuedname/versionare omitted). - Add
feature_view_metadata: List[FeatureViewMetadataResponse]toOnlineFeaturesMetadataResponseso the OpenAPI schema documents it. - In
RemoteOnlineStore._build_online_response_from_json, parse the field back into the proto.
I have a small PR with regression tests ready and will link it here.
AI assistance: drafted with an AI coding assistant (Claude). The reproduction above was run locally against the current default branch.
Activity
Zhuoxi2000 commentedon Oct 1, 2026
I'd like to take this one myself and will open a PR for it. I have a fix ready locally that passes
feature_view_metadatathrough on the REST path wheninclude_feature_view_version_metadatais set, plus a regression test. I'll rebase it on the latest master and open the PR shortly unless a maintainer would prefer a different approach.AI assistance: drafted with an AI coding assistant (Claude).