diff --git a/sdk/python/feast/feature_server.py b/sdk/python/feast/feature_server.py index e88b1eb5c28..e3ec16496cc 100644 --- a/sdk/python/feast/feature_server.py +++ b/sdk/python/feast/feature_server.py @@ -78,11 +78,13 @@ class MaterializeRequest(BaseModel): end_ts: Optional[str] = None feature_views: Optional[List[str]] = None disable_event_timestamp: bool = False + full_feature_names: bool = False class MaterializeIncrementalRequest(BaseModel): end_ts: str feature_views: Optional[List[str]] = None + full_feature_names: bool = False class GetOnlineFeaturesRequest(BaseModel): @@ -470,6 +472,7 @@ async def materialize(request: MaterializeRequest) -> None: end_date, request.feature_views, disable_event_timestamp=request.disable_event_timestamp, + full_feature_names=request.full_feature_names, ) @app.post("/materialize-incremental", dependencies=[Depends(inject_user_details)]) @@ -484,6 +487,7 @@ async def materialize_incremental(request: MaterializeIncrementalRequest) -> Non store.materialize_incremental, utils.make_tzaware(parser.parse(request.end_ts)), request.feature_views, + full_feature_names=request.full_feature_names, ) @app.exception_handler(Exception) diff --git a/sdk/python/feast/feature_store.py b/sdk/python/feast/feature_store.py index a866dc0f7a7..19a86825a62 100644 --- a/sdk/python/feast/feature_store.py +++ b/sdk/python/feast/feature_store.py @@ -1331,6 +1331,7 @@ def _materialize_odfv( feature_view: OnDemandFeatureView, start_date: datetime, end_date: datetime, + full_feature_names: bool, ): """Helper to materialize a single OnDemandFeatureView.""" if not feature_view.source_feature_view_projections: @@ -1428,6 +1429,7 @@ def _materialize_odfv( retrieval_job = self.get_historical_features( entity_df=entity_df, features=source_features_from_projections, + full_feature_names=full_feature_names, ) input_df = retrieval_job.to_df() transformed_df = self._transform_on_demand_feature_view_df( @@ -1439,6 +1441,7 @@ def materialize_incremental( self, end_date: datetime, feature_views: Optional[List[str]] = None, + full_feature_names: bool = False, ) -> None: """ Materialize incremental new data from the offline store into the online store. @@ -1453,6 +1456,8 @@ def materialize_incremental( end_date (datetime): End date for time range of data to materialize into the online store feature_views (List[str]): Optional list of feature view names. If selected, will only run materialization for the specified feature views. + full_feature_names (bool): If True, feature names will be prefixed with the corresponding + feature view name. Raises: Exception: A feature view being materialized does not have a TTL set. @@ -1498,7 +1503,12 @@ def materialize_incremental( print( f"{Style.BRIGHT + Fore.GREEN}{feature_view.name}{Style.RESET_ALL}:" ) - self._materialize_odfv(feature_view, odfv_start_date, end_date) + self._materialize_odfv( + feature_view, + odfv_start_date, + end_date, + full_feature_names=full_feature_names, + ) continue start_date = feature_view.most_recent_end_time @@ -1554,6 +1564,7 @@ def materialize( end_date: datetime, feature_views: Optional[List[str]] = None, disable_event_timestamp: bool = False, + full_feature_names: bool = False, ) -> None: """ Materialize data from the offline store into the online store. @@ -1568,6 +1579,8 @@ def materialize( feature_views (List[str]): Optional list of feature view names. If selected, will only run materialization for the specified feature views. disable_event_timestamp (bool): If True, materializes all available data using current datetime as event timestamp instead of source event timestamps + full_feature_names (bool): If True, feature names will be prefixed with the corresponding + feature view name. Examples: Materialize all features into the online store over the interval @@ -1603,7 +1616,12 @@ def materialize( print( f"{Style.BRIGHT + Fore.GREEN}{feature_view.name}{Style.RESET_ALL}:" ) - self._materialize_odfv(feature_view, start_date, end_date) + self._materialize_odfv( + feature_view, + start_date, + end_date, + full_feature_names=full_feature_names, + ) continue provider = self._get_provider() print(f"{Style.BRIGHT + Fore.GREEN}{feature_view.name}{Style.RESET_ALL}:")