4141class FeatureStore :
4242 """
4343 A FeatureStore object is used to define, create, and retrieve features.
44+
45+ Args:
46+ repo_path: Path to a `feature_store.yaml` used to configure the feature store
47+ config (RepoConfig): Configuration object used to configure the feature store
4448 """
4549
4650 config : RepoConfig
@@ -50,12 +54,6 @@ class FeatureStore:
5054 def __init__ (
5155 self , repo_path : Optional [str ] = None , config : Optional [RepoConfig ] = None ,
5256 ):
53- """ Initializes a new FeatureStore object. Used to manage a feature store.
54-
55- Args:
56- repo_path: Path to a `feature_store.yaml` used to configure the feature store
57- config (RepoConfig): Configuration object used to configure the feature store
58- """
5957 if repo_path is not None and config is not None :
6058 raise ValueError ("You cannot specify both repo_path and config" )
6159 if config is not None :
@@ -188,11 +186,13 @@ def apply(
188186 infrastructure (e.g., create tables in an online store) in order to reflect these new definitions. All
189187 operations are idempotent, meaning they can safely be rerun.
190188
191- Args: objects (List[Union[FeatureView, Entity]]): A list of FeatureView or Entity objects that should be
192- registered
189+ Args:
190+ objects (List[Union[FeatureView, Entity]]): A list of FeatureView or Entity objects that should be
191+ registered
193192
194193 Examples:
195194 Register a single Entity and FeatureView.
195+
196196 >>> from feast.feature_store import FeatureStore
197197 >>> from feast import Entity, FeatureView, Feature, ValueType, FileSource
198198 >>> from datetime import timedelta
@@ -219,16 +219,16 @@ def apply(
219219 views_to_update = []
220220 for ob in objects :
221221 if isinstance (ob , FeatureView ):
222- self ._registry .apply_feature_view (ob , project = self .config . project )
222+ self ._registry .apply_feature_view (ob , project = self .project )
223223 views_to_update .append (ob )
224224 elif isinstance (ob , Entity ):
225- self ._registry .apply_entity (ob , project = self .config . project )
225+ self ._registry .apply_entity (ob , project = self .project )
226226 else :
227227 raise ValueError (
228228 f"Unknown object type ({ type (ob )} ) provided as part of apply() call"
229229 )
230230 self ._get_provider ().update_infra (
231- project = self .config . project ,
231+ project = self .project ,
232232 tables_to_delete = [],
233233 tables_to_keep = views_to_update ,
234234 partial = True ,
@@ -263,6 +263,7 @@ def get_historical_features(
263263
264264 Examples:
265265 Retrieve historical features using a BigQuery SQL entity dataframe
266+
266267 >>> from feast.feature_store import FeatureStore
267268 >>>
268269 >>> fs = FeatureStore(config=RepoConfig(provider="gcp"))
@@ -275,9 +276,7 @@ def get_historical_features(
275276 """
276277 self ._tele .log ("get_historical_features" )
277278
278- all_feature_views = self ._registry .list_feature_views (
279- project = self .config .project
280- )
279+ all_feature_views = self ._registry .list_feature_views (project = self .project )
281280 try :
282281 feature_views = _get_requested_feature_views (
283282 feature_refs , all_feature_views
@@ -319,6 +318,7 @@ def materialize_incremental(
319318
320319 Examples:
321320 Materialize all features into the online store up to 5 minutes ago.
321+
322322 >>> from datetime import datetime, timedelta
323323 >>> from feast.feature_store import FeatureStore
324324 >>>
@@ -330,13 +330,11 @@ def materialize_incremental(
330330 feature_views_to_materialize = []
331331 if feature_views is None :
332332 feature_views_to_materialize = self ._registry .list_feature_views (
333- self .config . project
333+ self .project
334334 )
335335 else :
336336 for name in feature_views :
337- feature_view = self ._registry .get_feature_view (
338- name , self .config .project
339- )
337+ feature_view = self ._registry .get_feature_view (name , self .project )
340338 feature_views_to_materialize .append (feature_view )
341339
342340 # TODO paging large loads
@@ -378,6 +376,7 @@ def materialize(
378376 Examples:
379377 Materialize all features into the online store over the interval
380378 from 3 hours ago to 10 minutes ago.
379+
381380 >>> from datetime import datetime, timedelta
382381 >>> from feast.feature_store import FeatureStore
383382 >>>
@@ -396,13 +395,11 @@ def materialize(
396395 feature_views_to_materialize = []
397396 if feature_views is None :
398397 feature_views_to_materialize = self ._registry .list_feature_views (
399- self .config . project
398+ self .project
400399 )
401400 else :
402401 for name in feature_views :
403- feature_view = self ._registry .get_feature_view (
404- name , self .config .project
405- )
402+ feature_view = self ._registry .get_feature_view (name , self .project )
406403 feature_views_to_materialize .append (feature_view )
407404
408405 # TODO paging large loads
@@ -445,7 +442,7 @@ def get_online_features(
445442 >>> entity_rows = [{"customer_id": 0},{"customer_id": 1}]
446443 >>>
447444 >>> online_response = store.get_online_features(
448- >>> feature_refs, entity_rows, project="my_project" )
445+ >>> feature_refs, entity_rows)
449446 >>> online_response_dict = online_response.to_dict()
450447 >>> print(online_response_dict)
451448 {'sales:daily_transactions': [1.1,1.2], 'sales:customer_id': [0,1]}
@@ -481,7 +478,7 @@ def get_online_features(
481478 result_rows .append (_entity_row_to_field_values (entity_row_proto ))
482479
483480 all_feature_views = self ._registry .list_feature_views (
484- project = self .config . project , allow_cache = True
481+ project = self .project , allow_cache = True
485482 )
486483
487484 grouped_refs = _group_refs (feature_refs , all_feature_views )
0 commit comments