From cf58ebed02eaa8f8da234f9446277bbbb5195681 Mon Sep 17 00:00:00 2001 From: Tornike Gurgenidze Date: Tue, 26 Mar 2024 06:34:28 +0400 Subject: [PATCH] chore: Remove all usage of `RequestFeatureView` (#4039) remove all usage of RequestFeatureViews Signed-off-by: tokoko --- protos/feast/core/Registry.proto | 2 - protos/feast/core/RequestFeatureView.proto | 51 ------ protos/feast/registry/RegistryServer.proto | 22 --- .../docs/source/feast.protos.feast.core.rst | 16 -- sdk/python/docs/source/feast.rst | 8 - sdk/python/feast/__init__.py | 2 - sdk/python/feast/cli.py | 1 - sdk/python/feast/diff/registry_diff.py | 6 - sdk/python/feast/feast_object.py | 4 - sdk/python/feast/feature_store.py | 165 ++---------------- .../feast/infra/registry/base_registry.py | 43 ----- .../feast/infra/registry/caching_registry.py | 29 --- .../infra/registry/proto_registry_utils.py | 24 --- sdk/python/feast/infra/registry/registry.py | 45 +---- sdk/python/feast/infra/registry/remote.py | 26 --- sdk/python/feast/infra/registry/snowflake.py | 48 +---- sdk/python/feast/infra/registry/sql.py | 45 +---- .../registry/snowflake_table_creation.sql | 9 - .../registry/snowflake_table_deletion.sql | 2 - sdk/python/feast/registry_server.py | 17 -- sdk/python/feast/repo_contents.py | 5 - sdk/python/feast/repo_operations.py | 8 - sdk/python/feast/request_feature_view.py | 137 --------------- 23 files changed, 19 insertions(+), 696 deletions(-) delete mode 100644 protos/feast/core/RequestFeatureView.proto delete mode 100644 sdk/python/feast/request_feature_view.py diff --git a/protos/feast/core/Registry.proto b/protos/feast/core/Registry.proto index 7d80d8c837..0c3f8a53f9 100644 --- a/protos/feast/core/Registry.proto +++ b/protos/feast/core/Registry.proto @@ -27,7 +27,6 @@ import "feast/core/FeatureTable.proto"; import "feast/core/FeatureView.proto"; import "feast/core/InfraObject.proto"; import "feast/core/OnDemandFeatureView.proto"; -import "feast/core/RequestFeatureView.proto"; import "feast/core/StreamFeatureView.proto"; import "feast/core/DataSource.proto"; import "feast/core/SavedDataset.proto"; @@ -41,7 +40,6 @@ message Registry { repeated FeatureView feature_views = 6; repeated DataSource data_sources = 12; repeated OnDemandFeatureView on_demand_feature_views = 8; - repeated RequestFeatureView request_feature_views = 9; repeated StreamFeatureView stream_feature_views = 14; repeated FeatureService feature_services = 7; repeated SavedDataset saved_datasets = 11; diff --git a/protos/feast/core/RequestFeatureView.proto b/protos/feast/core/RequestFeatureView.proto deleted file mode 100644 index 4049053c2b..0000000000 --- a/protos/feast/core/RequestFeatureView.proto +++ /dev/null @@ -1,51 +0,0 @@ -// -// Copyright 2021 The Feast Authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// - - -syntax = "proto3"; -package feast.core; - -option go_package = "github.com/feast-dev/feast/go/protos/feast/core"; -option java_outer_classname = "RequestFeatureViewProto"; -option java_package = "feast.proto.core"; - -import "feast/core/DataSource.proto"; - -message RequestFeatureView { - // User-specified specifications of this feature view. - RequestFeatureViewSpec spec = 1; -} - -// Next available id: 7 -message RequestFeatureViewSpec { - // Name of the feature view. Must be unique. Not updated. - string name = 1; - - // Name of Feast project that this feature view belongs to. - string project = 2; - - // Request data which contains the underlying data schema and list of associated features - DataSource request_data_source = 3; - - // Description of the request feature view. - string description = 4; - - // User defined metadata. - map tags = 5; - - // Owner of the request feature view. - string owner = 6; -} diff --git a/protos/feast/registry/RegistryServer.proto b/protos/feast/registry/RegistryServer.proto index ab324f9bd1..e99987eb2d 100644 --- a/protos/feast/registry/RegistryServer.proto +++ b/protos/feast/registry/RegistryServer.proto @@ -7,7 +7,6 @@ import "feast/core/Registry.proto"; import "feast/core/Entity.proto"; import "feast/core/DataSource.proto"; import "feast/core/FeatureView.proto"; -import "feast/core/RequestFeatureView.proto"; import "feast/core/StreamFeatureView.proto"; import "feast/core/OnDemandFeatureView.proto"; import "feast/core/FeatureService.proto"; @@ -28,10 +27,6 @@ service RegistryServer{ rpc GetFeatureView (GetFeatureViewRequest) returns (feast.core.FeatureView) {} rpc ListFeatureViews (ListFeatureViewsRequest) returns (ListFeatureViewsResponse) {} - // RequestFeatureView RPCs - rpc GetRequestFeatureView (GetRequestFeatureViewRequest) returns (feast.core.RequestFeatureView) {} - rpc ListRequestFeatureViews (ListRequestFeatureViewsRequest) returns (ListRequestFeatureViewsResponse) {} - // StreamFeatureView RPCs rpc GetStreamFeatureView (GetStreamFeatureViewRequest) returns (feast.core.StreamFeatureView) {} rpc ListStreamFeatureViews (ListStreamFeatureViewsRequest) returns (ListStreamFeatureViewsResponse) {} @@ -126,23 +121,6 @@ message ListFeatureViewsResponse { repeated feast.core.FeatureView feature_views = 1; } -// RequestFeatureView - -message GetRequestFeatureViewRequest { - string name = 1; - string project = 2; - bool allow_cache = 3; -} - -message ListRequestFeatureViewsRequest { - string project = 1; - bool allow_cache = 2; -} - -message ListRequestFeatureViewsResponse { - repeated feast.core.RequestFeatureView request_feature_views = 1; -} - // StreamFeatureView message GetStreamFeatureViewRequest { diff --git a/sdk/python/docs/source/feast.protos.feast.core.rst b/sdk/python/docs/source/feast.protos.feast.core.rst index aaed49cd73..5da16d2a26 100644 --- a/sdk/python/docs/source/feast.protos.feast.core.rst +++ b/sdk/python/docs/source/feast.protos.feast.core.rst @@ -228,22 +228,6 @@ feast.protos.feast.core.Registry\_pb2\_grpc module :undoc-members: :show-inheritance: -feast.protos.feast.core.RequestFeatureView\_pb2 module ------------------------------------------------------- - -.. automodule:: feast.protos.feast.core.RequestFeatureView_pb2 - :members: - :undoc-members: - :show-inheritance: - -feast.protos.feast.core.RequestFeatureView\_pb2\_grpc module ------------------------------------------------------------- - -.. automodule:: feast.protos.feast.core.RequestFeatureView_pb2_grpc - :members: - :undoc-members: - :show-inheritance: - feast.protos.feast.core.SavedDataset\_pb2 module ------------------------------------------------ diff --git a/sdk/python/docs/source/feast.rst b/sdk/python/docs/source/feast.rst index b0ed92c4cc..abb8783bf0 100644 --- a/sdk/python/docs/source/feast.rst +++ b/sdk/python/docs/source/feast.rst @@ -273,14 +273,6 @@ feast.repo\_upgrade module :undoc-members: :show-inheritance: -feast.request\_feature\_view module ------------------------------------ - -.. automodule:: feast.request_feature_view - :members: - :undoc-members: - :show-inheritance: - feast.saved\_dataset module --------------------------- diff --git a/sdk/python/feast/__init__.py b/sdk/python/feast/__init__.py index d043f1a973..3eff91d65f 100644 --- a/sdk/python/feast/__init__.py +++ b/sdk/python/feast/__init__.py @@ -22,7 +22,6 @@ from .field import Field from .on_demand_feature_view import OnDemandFeatureView from .repo_config import RepoConfig -from .request_feature_view import RequestFeatureView from .stream_feature_view import StreamFeatureView from .value_type import ValueType @@ -49,7 +48,6 @@ "BigQuerySource", "FileSource", "RedshiftSource", - "RequestFeatureView", "SnowflakeSource", "PushSource", "RequestSource", diff --git a/sdk/python/feast/cli.py b/sdk/python/feast/cli.py index 7ce8aaef2b..7673eee20d 100644 --- a/sdk/python/feast/cli.py +++ b/sdk/python/feast/cli.py @@ -381,7 +381,6 @@ def feature_view_list(ctx: click.Context): table = [] for feature_view in [ *store.list_feature_views(), - *store.list_request_feature_views(), *store.list_on_demand_feature_views(), ]: entities = set() diff --git a/sdk/python/feast/diff/registry_diff.py b/sdk/python/feast/diff/registry_diff.py index 41b2142226..106d34bf48 100644 --- a/sdk/python/feast/diff/registry_diff.py +++ b/sdk/python/feast/diff/registry_diff.py @@ -20,9 +20,6 @@ OnDemandFeatureView as OnDemandFeatureViewProto, ) from feast.protos.feast.core.OnDemandFeatureView_pb2 import OnDemandFeatureViewSpec -from feast.protos.feast.core.RequestFeatureView_pb2 import ( - RequestFeatureView as RequestFeatureViewProto, -) from feast.protos.feast.core.StreamFeatureView_pb2 import ( StreamFeatureView as StreamFeatureViewProto, ) @@ -110,7 +107,6 @@ def tag_objects_for_keep_delete_update_add( FeatureViewProto, FeatureServiceProto, OnDemandFeatureViewProto, - RequestFeatureViewProto, StreamFeatureViewProto, ValidationReferenceProto, ) @@ -339,7 +335,6 @@ def apply_diff_to_registry( elif feast_object_diff.feast_object_type in [ FeastObjectType.FEATURE_VIEW, FeastObjectType.ON_DEMAND_FEATURE_VIEW, - FeastObjectType.REQUEST_FEATURE_VIEW, FeastObjectType.STREAM_FEATURE_VIEW, ]: feature_view_obj = cast( @@ -383,7 +378,6 @@ def apply_diff_to_registry( elif feast_object_diff.feast_object_type in [ FeastObjectType.FEATURE_VIEW, FeastObjectType.ON_DEMAND_FEATURE_VIEW, - FeastObjectType.REQUEST_FEATURE_VIEW, FeastObjectType.STREAM_FEATURE_VIEW, ]: registry.apply_feature_view( diff --git a/sdk/python/feast/feast_object.py b/sdk/python/feast/feast_object.py index 7cccf26455..2d06d8d669 100644 --- a/sdk/python/feast/feast_object.py +++ b/sdk/python/feast/feast_object.py @@ -11,12 +11,10 @@ from .protos.feast.core.FeatureService_pb2 import FeatureServiceSpec from .protos.feast.core.FeatureView_pb2 import FeatureViewSpec from .protos.feast.core.OnDemandFeatureView_pb2 import OnDemandFeatureViewSpec -from .protos.feast.core.RequestFeatureView_pb2 import RequestFeatureViewSpec from .protos.feast.core.StreamFeatureView_pb2 import StreamFeatureViewSpec from .protos.feast.core.ValidationProfile_pb2 import ( ValidationReference as ValidationReferenceProto, ) -from .request_feature_view import RequestFeatureView from .saved_dataset import ValidationReference from .stream_feature_view import StreamFeatureView @@ -24,7 +22,6 @@ FeastObject = Union[ FeatureView, OnDemandFeatureView, - RequestFeatureView, BatchFeatureView, StreamFeatureView, Entity, @@ -36,7 +33,6 @@ FeastObjectSpecProto = Union[ FeatureViewSpec, OnDemandFeatureViewSpec, - RequestFeatureViewSpec, StreamFeatureViewSpec, EntitySpecV2, FeatureServiceSpec, diff --git a/sdk/python/feast/feature_store.py b/sdk/python/feast/feature_store.py index 44236248fe..9ac2c14527 100644 --- a/sdk/python/feast/feature_store.py +++ b/sdk/python/feast/feature_store.py @@ -91,7 +91,6 @@ from feast.protos.feast.types.Value_pb2 import RepeatedValue, Value from feast.repo_config import RepoConfig, load_repo_config from feast.repo_contents import RepoContents -from feast.request_feature_view import RequestFeatureView from feast.saved_dataset import SavedDataset, SavedDatasetStorage, ValidationReference from feast.stream_feature_view import StreamFeatureView from feast.type_map import python_values_to_proto_values @@ -266,23 +265,6 @@ def list_feature_views(self, allow_cache: bool = False) -> List[FeatureView]: """ return self._list_feature_views(allow_cache) - @log_exceptions_and_usage - def list_request_feature_views( - self, allow_cache: bool = False - ) -> List[RequestFeatureView]: - """ - Retrieves the list of feature views from the registry. - - Args: - allow_cache: Whether to allow returning entities from a cached registry. - - Returns: - A list of feature views. - """ - return self._registry.list_request_feature_views( - self.project, allow_cache=allow_cache - ) - def _list_feature_views( self, allow_cache: bool = False, @@ -562,7 +544,6 @@ def _validate_all_feature_views( self, views_to_update: List[FeatureView], odfvs_to_update: List[OnDemandFeatureView], - request_views_to_update: List[RequestFeatureView], sfvs_to_update: List[StreamFeatureView], ): """Validates all feature views.""" @@ -577,7 +558,6 @@ def _validate_all_feature_views( [ *views_to_update, *odfvs_to_update, - *request_views_to_update, *sfvs_to_update, ] ) @@ -716,7 +696,6 @@ def plan( ... feature_views=[driver_hourly_stats_view], ... on_demand_feature_views=list(), ... stream_feature_views=list(), - ... request_feature_views=list(), ... entities=[driver], ... feature_services=list())) # register entity and feature view """ @@ -724,7 +703,6 @@ def plan( self._validate_all_feature_views( desired_repo_contents.feature_views, desired_repo_contents.on_demand_feature_views, - desired_repo_contents.request_feature_views, desired_repo_contents.stream_feature_views, ) _validate_data_sources(desired_repo_contents.data_sources) @@ -781,7 +759,6 @@ def apply( Entity, FeatureView, OnDemandFeatureView, - RequestFeatureView, BatchFeatureView, StreamFeatureView, FeatureService, @@ -848,9 +825,6 @@ def apply( ) ] sfvs_to_update = [ob for ob in objects if isinstance(ob, StreamFeatureView)] - request_views_to_update = [ - ob for ob in objects if isinstance(ob, RequestFeatureView) - ] odfvs_to_update = [ob for ob in objects if isinstance(ob, OnDemandFeatureView)] services_to_update = [ob for ob in objects if isinstance(ob, FeatureService)] data_sources_set_to_update = { @@ -877,16 +851,6 @@ def apply( if fv.stream_source: data_sources_set_to_update.add(fv.stream_source) - if request_views_to_update: - warnings.warn( - "Request feature view is deprecated. " - "Please use request data source instead", - DeprecationWarning, - ) - - for rfv in request_views_to_update: - data_sources_set_to_update.add(rfv.request_source) - for odfv in odfvs_to_update: for v in odfv.source_request_sources.values(): data_sources_set_to_update.add(v) @@ -898,7 +862,7 @@ def apply( # Validate all feature views and make inferences. self._validate_all_feature_views( - views_to_update, odfvs_to_update, request_views_to_update, sfvs_to_update + views_to_update, odfvs_to_update, sfvs_to_update ) self._make_inferences( data_sources_to_update, @@ -912,9 +876,7 @@ def apply( # Add all objects to the registry and update the provider's infrastructure. for ds in data_sources_to_update: self._registry.apply_data_source(ds, project=self.project, commit=False) - for view in itertools.chain( - views_to_update, odfvs_to_update, request_views_to_update, sfvs_to_update - ): + for view in itertools.chain(views_to_update, odfvs_to_update, sfvs_to_update): self._registry.apply_feature_view(view, project=self.project, commit=False) for ent in entities_to_update: self._registry.apply_entity(ent, project=self.project, commit=False) @@ -943,9 +905,6 @@ def apply( and not isinstance(ob, StreamFeatureView) ) ] - request_views_to_delete = [ - ob for ob in objects_to_delete if isinstance(ob, RequestFeatureView) - ] odfvs_to_delete = [ ob for ob in objects_to_delete if isinstance(ob, OnDemandFeatureView) ] @@ -974,10 +933,6 @@ def apply( self._registry.delete_feature_view( view.name, project=self.project, commit=False ) - for request_view in request_views_to_delete: - self._registry.delete_feature_view( - request_view.name, project=self.project, commit=False - ) for odfv in odfvs_to_delete: self._registry.delete_feature_view( odfv.name, project=self.project, commit=False @@ -1088,43 +1043,26 @@ def get_historical_features( _feature_refs = self._get_features(features) ( all_feature_views, - all_request_feature_views, all_on_demand_feature_views, ) = self._get_feature_views_to_use(features) - if all_request_feature_views: - warnings.warn( - "Request feature view is deprecated. " - "Please use request data source instead", - DeprecationWarning, - ) - # TODO(achal): _group_feature_refs returns the on demand feature views, but it's not passed into the provider. # This is a weird interface quirk - we should revisit the `get_historical_features` to # pass in the on demand feature views as well. - fvs, odfvs, request_fvs, request_fv_refs = _group_feature_refs( + fvs, odfvs = _group_feature_refs( _feature_refs, all_feature_views, - all_request_feature_views, all_on_demand_feature_views, ) feature_views = list(view for view, _ in fvs) on_demand_feature_views = list(view for view, _ in odfvs) - request_feature_views = list(view for view, _ in request_fvs) set_usage_attribute("odfv", bool(on_demand_feature_views)) - set_usage_attribute("request_fv", bool(request_feature_views)) # Check that the right request data is present in the entity_df if type(entity_df) == pd.DataFrame: if self.config.coerce_tz_aware: entity_df = utils.make_df_tzaware(cast(pd.DataFrame, entity_df)) - for fv in request_feature_views: - for feature in fv.features: - if feature.name not in entity_df.columns: - raise RequestDataNotFoundInEntityDfException( - feature_name=feature.name, feature_view_name=fv.name - ) for odfv in on_demand_feature_views: odfv_request_data_schema = odfv.get_request_data_schema() for feature_name in odfv_request_data_schema.keys(): @@ -1135,9 +1073,6 @@ def get_historical_features( ) _validate_feature_refs(_feature_refs, full_feature_names) - # Drop refs that refer to RequestFeatureViews since they don't need to be fetched and - # already exist in the entity_df - _feature_refs = [ref for ref in _feature_refs if ref not in request_fv_refs] provider = self._get_provider() job = provider.get_historical_features( @@ -1615,19 +1550,11 @@ def _get_online_features( _feature_refs = self._get_features(features, allow_cache=True) ( requested_feature_views, - requested_request_feature_views, requested_on_demand_feature_views, ) = self._get_feature_views_to_use( features=features, allow_cache=True, hide_dummy_entity=False ) - if requested_request_feature_views: - warnings.warn( - "Request feature view is deprecated. " - "Please use request data source instead", - DeprecationWarning, - ) - ( entity_name_to_join_key_map, entity_type_map, @@ -1648,19 +1575,12 @@ def _get_online_features( num_rows = _validate_entity_values(entity_proto_values) _validate_feature_refs(_feature_refs, full_feature_names) - ( - grouped_refs, - grouped_odfv_refs, - grouped_request_fv_refs, - _, - ) = _group_feature_refs( + (grouped_refs, grouped_odfv_refs,) = _group_feature_refs( _feature_refs, requested_feature_views, - requested_request_feature_views, requested_on_demand_feature_views, ) set_usage_attribute("odfv", bool(grouped_odfv_refs)) - set_usage_attribute("request_fv", bool(grouped_request_fv_refs)) # All requested features should be present in the result. requested_result_row_names = { @@ -1673,23 +1593,14 @@ def _get_online_features( feature_views = list(view for view, _ in grouped_refs) - needed_request_data, needed_request_fv_features = self.get_needed_request_data( - grouped_odfv_refs, grouped_request_fv_refs - ) + needed_request_data = self.get_needed_request_data(grouped_odfv_refs) join_key_values: Dict[str, List[Value]] = {} request_data_features: Dict[str, List[Value]] = {} # Entity rows may be either entities or request data. for join_key_or_entity_name, values in entity_proto_values.items(): # Found request data - if ( - join_key_or_entity_name in needed_request_data - or join_key_or_entity_name in needed_request_fv_features - ): - if join_key_or_entity_name in needed_request_fv_features: - # If the data was requested as a feature then - # make sure it appears in the result. - requested_result_row_names.add(join_key_or_entity_name) + if join_key_or_entity_name in needed_request_data: request_data_features[join_key_or_entity_name] = values else: if join_key_or_entity_name in join_keys_set: @@ -1711,7 +1622,7 @@ def _get_online_features( join_key_values[join_key] = values self.ensure_request_data_values_exist( - needed_request_data, needed_request_fv_features, request_data_features + needed_request_data, request_data_features ) # Populate online features response proto with join keys and request data features @@ -1870,33 +1781,21 @@ def _populate_result_rows_from_columnar( @staticmethod def get_needed_request_data( grouped_odfv_refs: List[Tuple[OnDemandFeatureView, List[str]]], - grouped_request_fv_refs: List[Tuple[RequestFeatureView, List[str]]], - ) -> Tuple[Set[str], Set[str]]: + ) -> Set[str]: needed_request_data: Set[str] = set() - needed_request_fv_features: Set[str] = set() for odfv, _ in grouped_odfv_refs: odfv_request_data_schema = odfv.get_request_data_schema() needed_request_data.update(odfv_request_data_schema.keys()) - for request_fv, _ in grouped_request_fv_refs: - for feature in request_fv.features: - needed_request_fv_features.add(feature.name) - return needed_request_data, needed_request_fv_features + return needed_request_data @staticmethod def ensure_request_data_values_exist( needed_request_data: Set[str], - needed_request_fv_features: Set[str], request_data_features: Dict[str, List[Any]], ): - if len(needed_request_data) + len(needed_request_fv_features) != len( - request_data_features.keys() - ): + if len(needed_request_data) != len(request_data_features.keys()): missing_features = [ - x - for x in itertools.chain( - needed_request_data, needed_request_fv_features - ) - if x not in request_data_features + x for x in needed_request_data if x not in request_data_features ] raise RequestDataNotFoundInEntityRowsException( feature_names=missing_features @@ -2161,7 +2060,7 @@ def _get_feature_views_to_use( features: Optional[Union[List[str], FeatureService]], allow_cache=False, hide_dummy_entity: bool = True, - ) -> Tuple[List[FeatureView], List[RequestFeatureView], List[OnDemandFeatureView]]: + ) -> Tuple[List[FeatureView], List[OnDemandFeatureView]]: fvs = { fv.name: fv for fv in [ @@ -2172,13 +2071,6 @@ def _get_feature_views_to_use( ] } - request_fvs = { - fv.name: fv - for fv in self._registry.list_request_feature_views( - project=self.project, allow_cache=allow_cache - ) - } - od_fvs = { fv.name: fv for fv in self._registry.list_on_demand_feature_views( @@ -2187,7 +2079,7 @@ def _get_feature_views_to_use( } if isinstance(features, FeatureService): - fvs_to_use, request_fvs_to_use, od_fvs_to_use = [], [], [] + fvs_to_use, od_fvs_to_use = [], [] for fv_name, projection in [ (projection.name, projection) for projection in features.feature_view_projections @@ -2196,10 +2088,6 @@ def _get_feature_views_to_use( fvs_to_use.append( fvs[fv_name].with_projection(copy.copy(projection)) ) - elif fv_name in request_fvs: - request_fvs_to_use.append( - request_fvs[fv_name].with_projection(copy.copy(projection)) - ) elif fv_name in od_fvs: odfv = od_fvs[fv_name].with_projection(copy.copy(projection)) od_fvs_to_use.append(odfv) @@ -2214,11 +2102,10 @@ def _get_feature_views_to_use( f"{fv_name} which doesn't exist. Please make sure that you have created the feature view" f'{fv_name} and that you have registered it by running "apply".' ) - views_to_use = (fvs_to_use, request_fvs_to_use, od_fvs_to_use) + views_to_use = (fvs_to_use, od_fvs_to_use) else: views_to_use = ( [*fvs.values()], - [*request_fvs.values()], [*od_fvs.values()], ) @@ -2456,24 +2343,15 @@ def _validate_feature_refs(feature_refs: List[str], full_feature_names: bool = F def _group_feature_refs( features: List[str], all_feature_views: List[FeatureView], - all_request_feature_views: List[RequestFeatureView], all_on_demand_feature_views: List[OnDemandFeatureView], ) -> Tuple[ - List[Tuple[FeatureView, List[str]]], - List[Tuple[OnDemandFeatureView, List[str]]], - List[Tuple[RequestFeatureView, List[str]]], - Set[str], + List[Tuple[FeatureView, List[str]]], List[Tuple[OnDemandFeatureView, List[str]]] ]: """Get list of feature views and corresponding feature names based on feature references""" # view name to view proto view_index = {view.projection.name_to_use(): view for view in all_feature_views} - # request view name to proto - request_view_index = { - view.projection.name_to_use(): view for view in all_request_feature_views - } - # on demand view to on demand view proto on_demand_view_index = { view.projection.name_to_use(): view for view in all_on_demand_feature_views @@ -2481,8 +2359,6 @@ def _group_feature_refs( # view name to feature names views_features = defaultdict(set) - request_views_features = defaultdict(set) - request_view_refs = set() # on demand view name to feature names on_demand_view_features = defaultdict(set) @@ -2503,26 +2379,17 @@ def _group_feature_refs( ].source_feature_view_projections.values(): for input_feat in input_fv_projection.features: views_features[input_fv_projection.name].add(input_feat.name) - elif view_name in request_view_index: - request_view_index[view_name].projection.get_feature( - feat_name - ) # For validation - request_views_features[view_name].add(feat_name) - request_view_refs.add(ref) else: raise FeatureViewNotFoundException(view_name) fvs_result: List[Tuple[FeatureView, List[str]]] = [] odfvs_result: List[Tuple[OnDemandFeatureView, List[str]]] = [] - request_fvs_result: List[Tuple[RequestFeatureView, List[str]]] = [] for view_name, feature_names in views_features.items(): fvs_result.append((view_index[view_name], list(feature_names))) - for view_name, feature_names in request_views_features.items(): - request_fvs_result.append((request_view_index[view_name], list(feature_names))) for view_name, feature_names in on_demand_view_features.items(): odfvs_result.append((on_demand_view_index[view_name], list(feature_names))) - return fvs_result, odfvs_result, request_fvs_result, request_view_refs + return fvs_result, odfvs_result def _print_materialization_log( diff --git a/sdk/python/feast/infra/registry/base_registry.py b/sdk/python/feast/infra/registry/base_registry.py index 583206941e..c874001c89 100644 --- a/sdk/python/feast/infra/registry/base_registry.py +++ b/sdk/python/feast/infra/registry/base_registry.py @@ -30,7 +30,6 @@ from feast.on_demand_feature_view import OnDemandFeatureView from feast.project_metadata import ProjectMetadata from feast.protos.feast.core.Registry_pb2 import Registry as RegistryProto -from feast.request_feature_view import RequestFeatureView from feast.saved_dataset import SavedDataset, ValidationReference from feast.stream_feature_view import StreamFeatureView from feast.transformation.pandas_transformation import PandasTransformation @@ -350,41 +349,6 @@ def list_feature_views( """ raise NotImplementedError - # request feature view operations - @abstractmethod - def get_request_feature_view( - self, name: str, project: str, allow_cache: bool = False - ) -> RequestFeatureView: - """ - Retrieves a request feature view. - - Args: - name: Name of request feature view - project: Feast project that this feature view belongs to - allow_cache: Allow returning feature view from the cached registry - - Returns: - Returns either the specified feature view, or raises an exception if - none is found - """ - raise NotImplementedError - - @abstractmethod - def list_request_feature_views( - self, project: str, allow_cache: bool = False - ) -> List[RequestFeatureView]: - """ - Retrieve a list of request feature views from the registry - - Args: - allow_cache: Allow returning feature views from the cached registry - project: Filter feature views based on project name - - Returns: - List of request feature views - """ - raise NotImplementedError - @abstractmethod def apply_materialization( self, @@ -699,13 +663,6 @@ def to_dict(self, project: str) -> Dict[str, List[Any]]: "body" ] = None registry_dict["onDemandFeatureViews"].append(odfv_dict) - for request_feature_view in sorted( - self.list_request_feature_views(project=project), - key=lambda request_feature_view: request_feature_view.name, - ): - registry_dict["requestFeatureViews"].append( - self._message_to_sorted_dict(request_feature_view.to_proto()) - ) for stream_feature_view in sorted( self.list_stream_feature_views(project=project), key=lambda stream_feature_view: stream_feature_view.name, diff --git a/sdk/python/feast/infra/registry/caching_registry.py b/sdk/python/feast/infra/registry/caching_registry.py index 4c408b0a46..3101b073d5 100644 --- a/sdk/python/feast/infra/registry/caching_registry.py +++ b/sdk/python/feast/infra/registry/caching_registry.py @@ -14,7 +14,6 @@ from feast.infra.registry.base_registry import BaseRegistry from feast.on_demand_feature_view import OnDemandFeatureView from feast.project_metadata import ProjectMetadata -from feast.request_feature_view import RequestFeatureView from feast.saved_dataset import SavedDataset, ValidationReference from feast.stream_feature_view import StreamFeatureView @@ -145,34 +144,6 @@ def list_on_demand_feature_views( ) return self._list_on_demand_feature_views(project) - @abstractmethod - def _get_request_feature_view(self, name: str, project: str) -> RequestFeatureView: - pass - - def get_request_feature_view( - self, name: str, project: str, allow_cache: bool = False - ) -> RequestFeatureView: - if allow_cache: - self._refresh_cached_registry_if_necessary() - return proto_registry_utils.get_request_feature_view( - self.cached_registry_proto, name, project - ) - return self._get_request_feature_view(name, project) - - @abstractmethod - def _list_request_feature_views(self, project: str) -> List[RequestFeatureView]: - pass - - def list_request_feature_views( - self, project: str, allow_cache: bool = False - ) -> List[RequestFeatureView]: - if allow_cache: - self._refresh_cached_registry_if_necessary() - return proto_registry_utils.list_request_feature_views( - self.cached_registry_proto, project - ) - return self._list_request_feature_views(project) - @abstractmethod def _get_stream_feature_view(self, name: str, project: str) -> StreamFeatureView: pass diff --git a/sdk/python/feast/infra/registry/proto_registry_utils.py b/sdk/python/feast/infra/registry/proto_registry_utils.py index e93f513b69..4d2e16cb02 100644 --- a/sdk/python/feast/infra/registry/proto_registry_utils.py +++ b/sdk/python/feast/infra/registry/proto_registry_utils.py @@ -19,7 +19,6 @@ from feast.project_metadata import ProjectMetadata from feast.protos.feast.core.Registry_pb2 import ProjectMetadata as ProjectMetadataProto from feast.protos.feast.core.Registry_pb2 import Registry as RegistryProto -from feast.request_feature_view import RequestFeatureView from feast.saved_dataset import SavedDataset, ValidationReference from feast.stream_feature_view import StreamFeatureView @@ -99,16 +98,6 @@ def get_stream_feature_view( raise FeatureViewNotFoundException(name, project) -def get_request_feature_view(registry_proto: RegistryProto, name: str, project: str): - for feature_view_proto in registry_proto.feature_views: - if ( - feature_view_proto.spec.name == name - and feature_view_proto.spec.project == project - ): - return RequestFeatureView.from_proto(feature_view_proto) - raise FeatureViewNotFoundException(name, project) - - def get_on_demand_feature_view( registry_proto: RegistryProto, name: str, project: str ) -> OnDemandFeatureView: @@ -180,19 +169,6 @@ def list_feature_views( return feature_views -@registry_proto_cache -def list_request_feature_views( - registry_proto: RegistryProto, project: str -) -> List[RequestFeatureView]: - feature_views: List[RequestFeatureView] = [] - for request_feature_view_proto in registry_proto.request_feature_views: - if request_feature_view_proto.spec.project == project: - feature_views.append( - RequestFeatureView.from_proto(request_feature_view_proto) - ) - return feature_views - - @registry_proto_cache def list_stream_feature_views( registry_proto: RegistryProto, project: str diff --git a/sdk/python/feast/infra/registry/registry.py b/sdk/python/feast/infra/registry/registry.py index a9d6c44f38..3c9843c904 100644 --- a/sdk/python/feast/infra/registry/registry.py +++ b/sdk/python/feast/infra/registry/registry.py @@ -46,7 +46,6 @@ from feast.protos.feast.core.Registry_pb2 import Registry as RegistryProto from feast.repo_config import RegistryConfig from feast.repo_contents import RepoContents -from feast.request_feature_view import RequestFeatureView from feast.saved_dataset import SavedDataset, ValidationReference from feast.stream_feature_view import StreamFeatureView @@ -73,7 +72,6 @@ class FeastObjectType(Enum): ENTITY = "entity" FEATURE_VIEW = "feature view" ON_DEMAND_FEATURE_VIEW = "on demand feature view" - REQUEST_FEATURE_VIEW = "request feature view" STREAM_FEATURE_VIEW = "stream feature view" FEATURE_SERVICE = "feature service" @@ -88,9 +86,6 @@ def get_objects_from_registry( FeastObjectType.ON_DEMAND_FEATURE_VIEW: registry.list_on_demand_feature_views( project=project ), - FeastObjectType.REQUEST_FEATURE_VIEW: registry.list_request_feature_views( - project=project - ), FeastObjectType.STREAM_FEATURE_VIEW: registry.list_stream_feature_views( project=project, ), @@ -108,7 +103,6 @@ def get_objects_from_repo_contents( FeastObjectType.ENTITY: repo_contents.entities, FeastObjectType.FEATURE_VIEW: repo_contents.feature_views, FeastObjectType.ON_DEMAND_FEATURE_VIEW: repo_contents.on_demand_feature_views, - FeastObjectType.REQUEST_FEATURE_VIEW: repo_contents.request_feature_views, FeastObjectType.STREAM_FEATURE_VIEW: repo_contents.stream_feature_views, FeastObjectType.FEATURE_SERVICE: repo_contents.feature_services, } @@ -402,10 +396,6 @@ def apply_feature_view( existing_feature_views_of_same_type = ( self.cached_registry_proto.on_demand_feature_views ) - elif isinstance(feature_view, RequestFeatureView): - existing_feature_views_of_same_type = ( - self.cached_registry_proto.request_feature_views - ) else: raise ValueError(f"Unexpected feature view type: {type(feature_view)}") @@ -532,24 +522,6 @@ def list_feature_views( ) return proto_registry_utils.list_feature_views(registry_proto, project) - def get_request_feature_view( - self, name: str, project: str, allow_cache: bool = False - ): - registry_proto = self._get_registry_proto( - project=project, allow_cache=allow_cache - ) - return proto_registry_utils.get_request_feature_view( - registry_proto, name, project - ) - - def list_request_feature_views( - self, project: str, allow_cache: bool = False - ) -> List[RequestFeatureView]: - registry_proto = self._get_registry_proto( - project=project, allow_cache=allow_cache - ) - return proto_registry_utils.list_request_feature_views(registry_proto, project) - def get_feature_view( self, name: str, project: str, allow_cache: bool = False ) -> FeatureView: @@ -601,18 +573,6 @@ def delete_feature_view(self, name: str, project: str, commit: bool = True): self.commit() return - for idx, existing_request_feature_view_proto in enumerate( - self.cached_registry_proto.request_feature_views - ): - if ( - existing_request_feature_view_proto.spec.name == name - and existing_request_feature_view_proto.spec.project == project - ): - del self.cached_registry_proto.request_feature_views[idx] - if commit: - self.commit() - return - for idx, existing_on_demand_feature_view_proto in enumerate( self.cached_registry_proto.on_demand_feature_views ): @@ -890,10 +850,7 @@ def _existing_feature_view_names_to_fvs(self) -> Dict[str, Message]: for fv in self.cached_registry_proto.on_demand_feature_views } fvs = {fv.spec.name: fv for fv in self.cached_registry_proto.feature_views} - request_fvs = { - fv.spec.name: fv for fv in self.cached_registry_proto.request_feature_views - } sfv = { fv.spec.name: fv for fv in self.cached_registry_proto.stream_feature_views } - return {**odfvs, **fvs, **request_fvs, **sfv} + return {**odfvs, **fvs, **sfv} diff --git a/sdk/python/feast/infra/registry/remote.py b/sdk/python/feast/infra/registry/remote.py index 67d61ffec7..f93e1ab1c0 100644 --- a/sdk/python/feast/infra/registry/remote.py +++ b/sdk/python/feast/infra/registry/remote.py @@ -19,7 +19,6 @@ from feast.protos.feast.core.Registry_pb2 import Registry as RegistryProto from feast.protos.feast.registry import RegistryServer_pb2, RegistryServer_pb2_grpc from feast.repo_config import RegistryConfig -from feast.request_feature_view import RequestFeatureView from feast.saved_dataset import SavedDataset, ValidationReference from feast.stream_feature_view import StreamFeatureView @@ -215,31 +214,6 @@ def list_feature_views( for feature_view in response.feature_views ] - def get_request_feature_view( - self, name: str, project: str, allow_cache: bool = False - ) -> RequestFeatureView: - request = RegistryServer_pb2.GetRequestFeatureViewRequest( - name=name, project=project, allow_cache=allow_cache - ) - - response = self.stub.GetRequestFeatureView(request) - - return RequestFeatureView.from_proto(response) - - def list_request_feature_views( - self, project: str, allow_cache: bool = False - ) -> List[RequestFeatureView]: - request = RegistryServer_pb2.ListRequestFeatureViewsRequest( - project=project, allow_cache=allow_cache - ) - - response = self.stub.ListRequestFeatureViews(request) - - return [ - RequestFeatureView.from_proto(request_feature_view) - for request_feature_view in response.request_feature_views - ] - def apply_materialization( self, feature_view: FeatureView, diff --git a/sdk/python/feast/infra/registry/snowflake.py b/sdk/python/feast/infra/registry/snowflake.py index cdf79c78b5..326d2e0226 100644 --- a/sdk/python/feast/infra/registry/snowflake.py +++ b/sdk/python/feast/infra/registry/snowflake.py @@ -44,9 +44,6 @@ OnDemandFeatureView as OnDemandFeatureViewProto, ) from feast.protos.feast.core.Registry_pb2 import Registry as RegistryProto -from feast.protos.feast.core.RequestFeatureView_pb2 import ( - RequestFeatureView as RequestFeatureViewProto, -) from feast.protos.feast.core.SavedDataset_pb2 import SavedDataset as SavedDatasetProto from feast.protos.feast.core.StreamFeatureView_pb2 import ( StreamFeatureView as StreamFeatureViewProto, @@ -55,7 +52,6 @@ ValidationReference as ValidationReferenceProto, ) from feast.repo_config import RegistryConfig -from feast.request_feature_view import RequestFeatureView from feast.saved_dataset import SavedDataset, ValidationReference from feast.stream_feature_view import StreamFeatureView @@ -370,7 +366,6 @@ def delete_feature_view(self, name: str, project: str, commit: bool = True): deleted_count = 0 for table in { "FEATURE_VIEWS", - "REQUEST_FEATURE_VIEWS", "ON_DEMAND_FEATURE_VIEWS", "STREAM_FEATURE_VIEWS", }: @@ -529,25 +524,6 @@ def get_on_demand_feature_view( FeatureViewNotFoundException, ) - def get_request_feature_view( - self, name: str, project: str, allow_cache: bool = False - ) -> RequestFeatureView: - if allow_cache: - self._refresh_cached_registry_if_necessary() - return proto_registry_utils.get_request_feature_view( - self.cached_registry_proto, name, project - ) - return self._get_object( - "REQUEST_FEATURE_VIEWS", - name, - project, - RequestFeatureViewProto, - RequestFeatureView, - "REQUEST_FEATURE_VIEW_NAME", - "REQUEST_FEATURE_VIEW_PROTO", - FeatureViewNotFoundException, - ) - def get_saved_dataset( self, name: str, project: str, allow_cache: bool = False ) -> SavedDataset: @@ -709,22 +685,6 @@ def list_on_demand_feature_views( "ON_DEMAND_FEATURE_VIEW_PROTO", ) - def list_request_feature_views( - self, project: str, allow_cache: bool = False - ) -> List[RequestFeatureView]: - if allow_cache: - self._refresh_cached_registry_if_necessary() - return proto_registry_utils.list_request_feature_views( - self.cached_registry_proto, project - ) - return self._list_objects( - "REQUEST_FEATURE_VIEWS", - project, - RequestFeatureViewProto, - RequestFeatureView, - "REQUEST_FEATURE_VIEW_PROTO", - ) - def list_saved_datasets( self, project: str, allow_cache: bool = False ) -> List[SavedDataset]: @@ -809,7 +769,7 @@ def apply_materialization( fv_column_name = fv_table_str[:-1] python_class, proto_class = self._infer_fv_classes(feature_view) - if python_class in {RequestFeatureView, OnDemandFeatureView}: + if python_class in {OnDemandFeatureView}: raise ValueError( f"Cannot apply materialization for feature {feature_view.name} of type {python_class}" ) @@ -933,7 +893,6 @@ def proto(self) -> RegistryProto: (self.list_feature_views, r.feature_views), (self.list_data_sources, r.data_sources), (self.list_on_demand_feature_views, r.on_demand_feature_views), - (self.list_request_feature_views, r.request_feature_views), (self.list_stream_feature_views, r.stream_feature_views), (self.list_feature_services, r.feature_services), (self.list_saved_datasets, r.saved_datasets), @@ -968,7 +927,6 @@ def _get_all_projects(self) -> Set[str]: "ENTITIES", "FEATURE_VIEWS", "ON_DEMAND_FEATURE_VIEWS", - "REQUEST_FEATURE_VIEWS", "STREAM_FEATURE_VIEWS", ] @@ -1010,8 +968,6 @@ def _infer_fv_classes(self, feature_view): python_class, proto_class = FeatureView, FeatureViewProto elif isinstance(feature_view, OnDemandFeatureView): python_class, proto_class = OnDemandFeatureView, OnDemandFeatureViewProto - elif isinstance(feature_view, RequestFeatureView): - python_class, proto_class = RequestFeatureView, RequestFeatureViewProto else: raise ValueError(f"Unexpected feature view type: {type(feature_view)}") return python_class, proto_class @@ -1023,8 +979,6 @@ def _infer_fv_table(self, feature_view) -> str: table = "FEATURE_VIEWS" elif isinstance(feature_view, OnDemandFeatureView): table = "ON_DEMAND_FEATURE_VIEWS" - elif isinstance(feature_view, RequestFeatureView): - table = "REQUEST_FEATURE_VIEWS" else: raise ValueError(f"Unexpected feature view type: {type(feature_view)}") return table diff --git a/sdk/python/feast/infra/registry/sql.py b/sdk/python/feast/infra/registry/sql.py index 597c9b8513..2077ba4aae 100644 --- a/sdk/python/feast/infra/registry/sql.py +++ b/sdk/python/feast/infra/registry/sql.py @@ -50,9 +50,6 @@ OnDemandFeatureView as OnDemandFeatureViewProto, ) from feast.protos.feast.core.Registry_pb2 import Registry as RegistryProto -from feast.protos.feast.core.RequestFeatureView_pb2 import ( - RequestFeatureView as RequestFeatureViewProto, -) from feast.protos.feast.core.SavedDataset_pb2 import SavedDataset as SavedDatasetProto from feast.protos.feast.core.StreamFeatureView_pb2 import ( StreamFeatureView as StreamFeatureViewProto, @@ -61,7 +58,6 @@ ValidationReference as ValidationReferenceProto, ) from feast.repo_config import RegistryConfig -from feast.request_feature_view import RequestFeatureView from feast.saved_dataset import SavedDataset, ValidationReference from feast.stream_feature_view import StreamFeatureView @@ -96,16 +92,6 @@ Column("user_metadata", LargeBinary, nullable=True), ) -request_feature_views = Table( - "request_feature_views", - metadata, - Column("feature_view_name", String(50), primary_key=True), - Column("project_id", String(50), primary_key=True), - Column("last_updated_timestamp", BigInteger, nullable=False), - Column("feature_view_proto", LargeBinary, nullable=False), - Column("user_metadata", LargeBinary, nullable=True), -) - stream_feature_views = Table( "stream_feature_views", metadata, @@ -216,7 +202,6 @@ def teardown(self): feature_views, feature_services, on_demand_feature_views, - request_feature_views, saved_datasets, validation_references, }: @@ -292,18 +277,6 @@ def _get_on_demand_feature_view( not_found_exception=FeatureViewNotFoundException, ) - def _get_request_feature_view(self, name: str, project: str): - return self._get_object( - table=request_feature_views, - name=name, - project=project, - proto_class=RequestFeatureViewProto, - python_class=RequestFeatureView, - id_field_name="feature_view_name", - proto_field_name="feature_view_proto", - not_found_exception=FeatureViewNotFoundException, - ) - def _get_feature_service(self, name: str, project: str) -> FeatureService: return self._get_object( table=feature_services, @@ -363,7 +336,6 @@ def delete_feature_view(self, name: str, project: str, commit: bool = True): deleted_count = 0 for table in { feature_views, - request_feature_views, on_demand_feature_views, stream_feature_views, }: @@ -459,15 +431,6 @@ def _list_saved_datasets(self, project: str) -> List[SavedDataset]: "saved_dataset_proto", ) - def _list_request_feature_views(self, project: str) -> List[RequestFeatureView]: - return self._list_objects( - request_feature_views, - project, - RequestFeatureViewProto, - RequestFeatureView, - "feature_view_proto", - ) - def _list_on_demand_feature_views(self, project: str) -> List[OnDemandFeatureView]: return self._list_objects( on_demand_feature_views, @@ -532,7 +495,7 @@ def apply_materialization( table = self._infer_fv_table(feature_view) python_class, proto_class = self._infer_fv_classes(feature_view) - if python_class in {RequestFeatureView, OnDemandFeatureView}: + if python_class in {OnDemandFeatureView}: raise ValueError( f"Cannot apply materialization for feature {feature_view.name} of type {python_class}" ) @@ -628,8 +591,6 @@ def _infer_fv_table(self, feature_view): table = feature_views elif isinstance(feature_view, OnDemandFeatureView): table = on_demand_feature_views - elif isinstance(feature_view, RequestFeatureView): - table = request_feature_views else: raise ValueError(f"Unexpected feature view type: {type(feature_view)}") return table @@ -641,8 +602,6 @@ def _infer_fv_classes(self, feature_view): python_class, proto_class = FeatureView, FeatureViewProto elif isinstance(feature_view, OnDemandFeatureView): python_class, proto_class = OnDemandFeatureView, OnDemandFeatureViewProto - elif isinstance(feature_view, RequestFeatureView): - python_class, proto_class = RequestFeatureView, RequestFeatureViewProto else: raise ValueError(f"Unexpected feature view type: {type(feature_view)}") return python_class, proto_class @@ -671,7 +630,6 @@ def proto(self) -> RegistryProto: (self.list_feature_views, r.feature_views), (self.list_data_sources, r.data_sources), (self.list_on_demand_feature_views, r.on_demand_feature_views), - (self.list_request_feature_views, r.request_feature_views), (self.list_stream_feature_views, r.stream_feature_views), (self.list_feature_services, r.feature_services), (self.list_saved_datasets, r.saved_datasets), @@ -905,7 +863,6 @@ def _get_all_projects(self) -> Set[str]: entities, data_sources, feature_views, - request_feature_views, on_demand_feature_views, stream_feature_views, }: diff --git a/sdk/python/feast/infra/utils/snowflake/registry/snowflake_table_creation.sql b/sdk/python/feast/infra/utils/snowflake/registry/snowflake_table_creation.sql index 4b53d6bb3f..aa35caeac4 100644 --- a/sdk/python/feast/infra/utils/snowflake/registry/snowflake_table_creation.sql +++ b/sdk/python/feast/infra/utils/snowflake/registry/snowflake_table_creation.sql @@ -57,15 +57,6 @@ CREATE TABLE IF NOT EXISTS REGISTRY_PATH."ON_DEMAND_FEATURE_VIEWS" ( PRIMARY KEY (on_demand_feature_view_name, project_id) ); -CREATE TABLE IF NOT EXISTS REGISTRY_PATH."REQUEST_FEATURE_VIEWS" ( - request_feature_view_name VARCHAR, - project_id VARCHAR, - last_updated_timestamp TIMESTAMP_LTZ NOT NULL, - request_feature_view_proto BINARY NOT NULL, - user_metadata BINARY, - PRIMARY KEY (request_feature_view_name, project_id) -); - CREATE TABLE IF NOT EXISTS REGISTRY_PATH."SAVED_DATASETS" ( saved_dataset_name VARCHAR, project_id VARCHAR, diff --git a/sdk/python/feast/infra/utils/snowflake/registry/snowflake_table_deletion.sql b/sdk/python/feast/infra/utils/snowflake/registry/snowflake_table_deletion.sql index 7f5c1991ea..a355c72062 100644 --- a/sdk/python/feast/infra/utils/snowflake/registry/snowflake_table_deletion.sql +++ b/sdk/python/feast/infra/utils/snowflake/registry/snowflake_table_deletion.sql @@ -12,8 +12,6 @@ DROP TABLE IF EXISTS REGISTRY_PATH."MANAGED_INFRA"; DROP TABLE IF EXISTS REGISTRY_PATH."ON_DEMAND_FEATURE_VIEWS"; -DROP TABLE IF EXISTS REGISTRY_PATH."REQUEST_FEATURE_VIEWS"; - DROP TABLE IF EXISTS REGISTRY_PATH."SAVED_DATASETS"; DROP TABLE IF EXISTS REGISTRY_PATH."STREAM_FEATURE_VIEWS"; diff --git a/sdk/python/feast/registry_server.py b/sdk/python/feast/registry_server.py index 221715480e..7de0cc43e1 100644 --- a/sdk/python/feast/registry_server.py +++ b/sdk/python/feast/registry_server.py @@ -59,23 +59,6 @@ def ListFeatureViews(self, request, context): ] ) - def GetRequestFeatureView( - self, request: RegistryServer_pb2.GetRequestFeatureViewRequest, context - ): - return self.proxied_registry.get_request_feature_view( - name=request.name, project=request.project, allow_cache=request.allow_cache - ).to_proto() - - def ListRequestFeatureViews(self, request, context): - return RegistryServer_pb2.ListRequestFeatureViewsResponse( - request_feature_views=[ - request_feature_view.to_proto() - for request_feature_view in self.proxied_registry.list_request_feature_views( - project=request.project, allow_cache=request.allow_cache - ) - ] - ) - def GetStreamFeatureView( self, request: RegistryServer_pb2.GetStreamFeatureViewRequest, context ): diff --git a/sdk/python/feast/repo_contents.py b/sdk/python/feast/repo_contents.py index fe5cbd284b..33b99f29b2 100644 --- a/sdk/python/feast/repo_contents.py +++ b/sdk/python/feast/repo_contents.py @@ -19,7 +19,6 @@ from feast.feature_view import FeatureView from feast.on_demand_feature_view import OnDemandFeatureView from feast.protos.feast.core.Registry_pb2 import Registry as RegistryProto -from feast.request_feature_view import RequestFeatureView from feast.stream_feature_view import StreamFeatureView @@ -31,7 +30,6 @@ class RepoContents(NamedTuple): data_sources: List[DataSource] feature_views: List[FeatureView] on_demand_feature_views: List[OnDemandFeatureView] - request_feature_views: List[RequestFeatureView] stream_feature_views: List[StreamFeatureView] entities: List[Entity] feature_services: List[FeatureService] @@ -46,9 +44,6 @@ def to_registry_proto(self) -> RegistryProto: registry_proto.on_demand_feature_views.extend( [fv.to_proto() for fv in self.on_demand_feature_views] ) - registry_proto.request_feature_views.extend( - [fv.to_proto() for fv in self.request_feature_views] - ) registry_proto.feature_services.extend( [fs.to_proto() for fs in self.feature_services] ) diff --git a/sdk/python/feast/repo_operations.py b/sdk/python/feast/repo_operations.py index 120f6e7a42..000e000438 100644 --- a/sdk/python/feast/repo_operations.py +++ b/sdk/python/feast/repo_operations.py @@ -29,7 +29,6 @@ from feast.on_demand_feature_view import OnDemandFeatureView from feast.repo_config import RepoConfig from feast.repo_contents import RepoContents -from feast.request_feature_view import RequestFeatureView from feast.stream_feature_view import StreamFeatureView from feast.usage import log_exceptions_and_usage @@ -114,7 +113,6 @@ def parse_repo(repo_root: Path) -> RepoContents: feature_services=[], on_demand_feature_views=[], stream_feature_views=[], - request_feature_views=[], ) for repo_file in get_repo_files(repo_root): @@ -196,10 +194,6 @@ def parse_repo(repo_root: Path) -> RepoContents: (obj is odfv) for odfv in res.on_demand_feature_views ): res.on_demand_feature_views.append(obj) - elif isinstance(obj, RequestFeatureView) and not any( - (obj is rfv) for rfv in res.request_feature_views - ): - res.request_feature_views.append(obj) res.entities.append(DUMMY_ENTITY) return res @@ -250,7 +244,6 @@ def extract_objects_for_apply_delete(project, registry, repo): Union[ Entity, FeatureView, - RequestFeatureView, OnDemandFeatureView, StreamFeatureView, FeatureService, @@ -264,7 +257,6 @@ def extract_objects_for_apply_delete(project, registry, repo): Union[ Entity, FeatureView, - RequestFeatureView, OnDemandFeatureView, StreamFeatureView, FeatureService, diff --git a/sdk/python/feast/request_feature_view.py b/sdk/python/feast/request_feature_view.py deleted file mode 100644 index 7248ffe989..0000000000 --- a/sdk/python/feast/request_feature_view.py +++ /dev/null @@ -1,137 +0,0 @@ -import copy -import warnings -from typing import Dict, List, Optional, Type - -from feast.base_feature_view import BaseFeatureView -from feast.data_source import RequestSource -from feast.feature_view_projection import FeatureViewProjection -from feast.field import Field -from feast.protos.feast.core.RequestFeatureView_pb2 import ( - RequestFeatureView as RequestFeatureViewProto, -) -from feast.protos.feast.core.RequestFeatureView_pb2 import RequestFeatureViewSpec -from feast.usage import log_exceptions - - -class RequestFeatureView(BaseFeatureView): - """ - [Experimental] A RequestFeatureView defines a logical group of features that should - be available as an input to an on demand feature view at request time. - - Attributes: - name: The unique name of the request feature view. - request_source: The request source that specifies the schema and - features of the request feature view. - features: The list of features defined as part of this request feature view. - description: A human-readable description. - tags: A dictionary of key-value pairs to store arbitrary metadata. - owner: The owner of the request feature view, typically the email of the primary - maintainer. - """ - - name: str - request_source: RequestSource - features: List[Field] - description: str - tags: Dict[str, str] - owner: str - - @log_exceptions - def __init__( - self, - name: str, - request_data_source: RequestSource, - description: str = "", - tags: Optional[Dict[str, str]] = None, - owner: str = "", - ): - """ - Creates a RequestFeatureView object. - - Args: - name: The unique name of the request feature view. - request_data_source: The request data source that specifies the schema and - features of the request feature view. - description (optional): A human-readable description. - tags (optional): A dictionary of key-value pairs to store arbitrary metadata. - owner (optional): The owner of the request feature view, typically the email - of the primary maintainer. - """ - warnings.warn( - "Request feature view is deprecated. " - "Please use request data source instead", - DeprecationWarning, - ) - - if isinstance(request_data_source.schema, Dict): - new_features = [ - Field(name=name, dtype=dtype) - for name, dtype in request_data_source.schema.items() - ] - else: - new_features = request_data_source.schema - - super().__init__( - name=name, - features=new_features, - description=description, - tags=tags, - owner=owner, - ) - self.request_source = request_data_source - - @property - def proto_class(self) -> Type[RequestFeatureViewProto]: - return RequestFeatureViewProto - - def to_proto(self) -> RequestFeatureViewProto: - """ - Converts an request feature view object to its protobuf representation. - - Returns: - A RequestFeatureViewProto protobuf. - """ - spec = RequestFeatureViewSpec( - name=self.name, - request_data_source=self.request_source.to_proto(), - description=self.description, - tags=self.tags, - owner=self.owner, - ) - - return RequestFeatureViewProto(spec=spec) - - @classmethod - def from_proto(cls, request_feature_view_proto: RequestFeatureViewProto): - """ - Creates a request feature view from a protobuf representation. - - Args: - request_feature_view_proto: A protobuf representation of an request feature view. - - Returns: - A RequestFeatureView object based on the request feature view protobuf. - """ - - request_feature_view_obj = cls( - name=request_feature_view_proto.spec.name, - request_data_source=RequestSource.from_proto( - request_feature_view_proto.spec.request_data_source - ), - description=request_feature_view_proto.spec.description, - tags=dict(request_feature_view_proto.spec.tags), - owner=request_feature_view_proto.spec.owner, - ) - - # FeatureViewProjections are not saved in the RequestFeatureView proto. - # Create the default projection. - request_feature_view_obj.projection = FeatureViewProjection.from_definition( - request_feature_view_obj - ) - - return request_feature_view_obj - - def __copy__(self): - fv = RequestFeatureView(name=self.name, request_data_source=self.request_source) - fv.projection = copy.copy(self.projection) - return fv