Skip to content

Commit 4e3b757

Browse files
authored
Remove project reference from feature set id in stats example notebook (#836)
* Remove project reference from feature set id * Rename default_project to project * Remove format
1 parent 4da4b23 commit 4e3b757

2 files changed

Lines changed: 8 additions & 13 deletions

File tree

‎examples/statistics/Historical Feature Statistics with Feast, TFDV and Facets.ipynb‎

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -56,10 +56,6 @@
5656
"BIGQUERY_STORE_NAME = \"historical\"\n",
5757
"client = Client(core_url=\"localhost:6565\")\n",
5858
"print(f\"setting project to {PROJECT_NAME}...\")\n",
59-
"try:\n",
60-
" client.create_project(PROJECT_NAME)\n",
61-
"except:\n",
62-
" print(\"project already exists, skipping.\")\n",
6359
"client.set_project(PROJECT_NAME)"
6460
]
6561
},
@@ -393,7 +389,7 @@
393389
"# Get statistics from Feast for the ingested dataset.\n",
394390
"# The statistics are calculated over the data in the store specified.\n",
395391
"stats = client.get_statistics(\n",
396-
" feature_set_id=f'{PROJECT_NAME}/iris', \n",
392+
" feature_set_id='iris', \n",
397393
" store=BIGQUERY_STORE_NAME, \n",
398394
" features=iris_feature_names, \n",
399395
" ingestion_ids=[ingestion_id])"
@@ -659,7 +655,7 @@
659655
"\n",
660656
"# Compute statistics over the new dataset\n",
661657
"stats_2 = client.get_statistics(\n",
662-
" feature_set_id=f'{PROJECT_NAME}/iris', \n",
658+
" feature_set_id='iris', \n",
663659
" store=BIGQUERY_STORE_NAME, \n",
664660
" features=iris_feature_names, \n",
665661
" ingestion_ids=[ingestion_id_2])\n",
@@ -691,4 +687,4 @@
691687
},
692688
"nbformat": 4,
693689
"nbformat_minor": 2
694-
}
690+
}

‎sdk/python/feast/client.py‎

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -885,15 +885,14 @@ def get_statistics(
885885
start_date: Optional[datetime.datetime] = None,
886886
end_date: Optional[datetime.datetime] = None,
887887
force_refresh: bool = False,
888-
default_project: Optional[str] = None,
888+
project: Optional[str] = None,
889889
) -> statistics_pb2.DatasetFeatureStatisticsList:
890890
"""
891891
Retrieves the feature featureStatistics computed over the data in the batch
892892
stores.
893893
894894
Args:
895-
feature_set_id: Fully qualified feature set id in the format
896-
project/feature_set to retrieve batch featureStatistics for. If project
895+
feature_set_id: Feature set id to retrieve batch featureStatistics for. If project
897896
is not provided, the default ("default") will be used.
898897
store: Name of the store to retrieve feature featureStatistics over. This
899898
store must be a historical store.
@@ -913,7 +912,7 @@ def get_statistics(
913912
multiple days, unaggregatable featureStatistics will be dropped.
914913
force_refresh: Setting this flag to true will force a recalculation
915914
of featureStatistics and overwrite results currently in the cache, if any.
916-
default_project: Manual override for default project.
915+
project: Manual override for default project.
917916
918917
Returns:
919918
Returns a tensorflow DatasetFeatureStatisticsList containing TFDV featureStatistics.
@@ -926,8 +925,8 @@ def get_statistics(
926925
"Only one of dataset_id or [start_date, end_date] can be provided."
927926
)
928927

929-
if default_project != "" and "/" not in feature_set_id:
930-
feature_set_id = f"{default_project}/{feature_set_id}"
928+
if project != "" and "/" not in feature_set_id:
929+
feature_set_id = f"{project}/{feature_set_id}"
931930

932931
request = GetFeatureStatisticsRequest(
933932
feature_set_id=feature_set_id,

0 commit comments

Comments
 (0)