Skip to content

Commit

Permalink
fix: write_to_online_store checks for feature views instead of sfv
Browse files Browse the repository at this point in the history
  • Loading branch information
Bhargav Dodla committed Mar 13, 2024
1 parent d9f3880 commit f0a21d9
Showing 1 changed file with 12 additions and 8 deletions.
20 changes: 12 additions & 8 deletions sdk/python/feast/feature_store.py
Original file line number Diff line number Diff line change
Expand Up @@ -1498,12 +1498,14 @@ def write_to_online_store(
allow_registry_cache (optional): Whether to allow retrieving feature views from a cached registry.
"""
# TODO: restrict this to work with online StreamFeatureViews and validate the FeatureView type
# In EG, we use feature view to support streaming and http registry is not implemented for stream feature views
# HTTP Registry raises MethodNotImplementedError for get_stream_feature_view
try:
feature_view = self.get_stream_feature_view(
feature_view = self.get_feature_view(
feature_view_name, allow_registry_cache=allow_registry_cache
)
except FeatureViewNotFoundException:
feature_view = self.get_feature_view(
feature_view = self.get_stream_feature_view(
feature_view_name, allow_registry_cache=allow_registry_cache
)
provider = self._get_provider()
Expand Down Expand Up @@ -1663,9 +1665,9 @@ def _get_online_features(

return self._go_server.get_online_features(
features_refs=features if isinstance(features, list) else [],
feature_service=features
if isinstance(features, FeatureService)
else None,
feature_service=(
features if isinstance(features, FeatureService) else None
),
entities=entity_native_values,
request_data={}, # TODO: add request data parameter to public API
full_feature_names=full_feature_names,
Expand Down Expand Up @@ -2093,9 +2095,11 @@ def _populate_response_from_feature_data(
"""
# Add the feature names to the response.
requested_feature_refs = [
f"{table.projection.name_to_use()}__{feature_name}"
if full_feature_names
else feature_name
(
f"{table.projection.name_to_use()}__{feature_name}"
if full_feature_names
else feature_name
)
for feature_name in requested_features
]
online_features_response.metadata.feature_names.val.extend(
Expand Down

0 comments on commit f0a21d9

Please sign in to comment.