@@ -784,12 +784,12 @@ def get_historical_features(
784784 columns (e.g., customer_id, driver_id) on which features need to be joined, as well as a event_timestamp
785785 column used to ensure point-in-time correctness. Either a Pandas DataFrame can be provided or a string
786786 SQL query. The query must be of a format supported by the configured offline store (e.g., BigQuery)
787- features: A list of features, that should be retrieved from the offline store.
788- Either a list of string feature references can be provided or a FeatureService object.
789- Feature references are of the format "feature_view:feature", e.g., "customer_fv:daily_transactions".
790- full_feature_names: A boolean that provides the option to add the feature view prefixes to the feature names ,
791- changing them from the format "feature" to "feature_view__feature" (e.g., "daily_transactions" changes to
792- "customer_fv__daily_transactions"). By default, this value is set to False .
787+ features: The list of features that should be retrieved from the offline store. These features can be
788+ specified either as a list of string feature references or as a feature service. String feature
789+ references must have format "feature_view:feature", e.g. "customer_fv:daily_transactions".
790+ full_feature_names: If True, feature names will be prefixed with the corresponding feature view name ,
791+ changing them from the format "feature" to "feature_view__feature" (e.g. "daily_transactions"
792+ changes to "customer_fv__daily_transactions").
793793
794794 Returns:
795795 RetrievalJob which can be used to materialize the results.
@@ -822,7 +822,6 @@ def get_historical_features(
822822 ... )
823823 >>> feature_data = retrieval_job.to_df()
824824 """
825-
826825 _feature_refs = self ._get_features (features )
827826 (
828827 all_feature_views ,
@@ -1194,12 +1193,13 @@ def get_online_features(
11941193 infinity (cache forever).
11951194
11961195 Args:
1197- features: List of feature references that will be returned for each entity.
1198- Each feature reference should have the following format:
1199- "feature_view:feature" where "feature_view" & "feature" refer to
1200- the Feature and FeatureView names respectively.
1201- Only the feature name is required.
1196+ features: The list of features that should be retrieved from the online store. These features can be
1197+ specified either as a list of string feature references or as a feature service. String feature
1198+ references must have format "feature_view:feature", e.g. "customer_fv:daily_transactions".
12021199 entity_rows: A list of dictionaries where each key-value is an entity-name, entity-value pair.
1200+ full_feature_names: If True, feature names will be prefixed with the corresponding feature view name,
1201+ changing them from the format "feature" to "feature_view__feature" (e.g. "daily_transactions"
1202+ changes to "customer_fv__daily_transactions").
12031203
12041204 Returns:
12051205 OnlineResponse containing the feature data in records.
@@ -1870,16 +1870,26 @@ def _validate_entity_values(join_key_values: Dict[str, List[Value]]):
18701870
18711871
18721872def _validate_feature_refs (feature_refs : List [str ], full_feature_names : bool = False ):
1873+ """
1874+ Validates that there are no collisions among the feature references.
1875+
1876+ Args:
1877+ feature_refs: List of feature references to validate. Feature references must have format
1878+ "feature_view:feature", e.g. "customer_fv:daily_transactions".
1879+ full_feature_names: If True, the full feature references are compared for collisions; if False,
1880+ only the feature names are compared.
1881+
1882+ Raises:
1883+ FeatureNameCollisionError: There is a collision among the feature references.
1884+ """
18731885 collided_feature_refs = []
18741886
18751887 if full_feature_names :
18761888 collided_feature_refs = [
18771889 ref for ref , occurrences in Counter (feature_refs ).items () if occurrences > 1
18781890 ]
18791891 else :
1880- feature_names = [
1881- ref .split (":" )[1 ] if ":" in ref else ref for ref in feature_refs
1882- ]
1892+ feature_names = [ref .split (":" )[1 ] for ref in feature_refs ]
18831893 collided_feature_names = [
18841894 ref
18851895 for ref , occurrences in Counter (feature_names ).items ()
0 commit comments