Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,6 @@
"BIGQUERY_STORE_NAME = \"historical\"\n",
"client = Client(core_url=\"localhost:6565\")\n",
"print(f\"setting project to {PROJECT_NAME}...\")\n",
"try:\n",
" client.create_project(PROJECT_NAME)\n",
"except:\n",
" print(\"project already exists, skipping.\")\n",
"client.set_project(PROJECT_NAME)"
]
},
Expand Down Expand Up @@ -393,7 +389,7 @@
"# Get statistics from Feast for the ingested dataset.\n",
"# The statistics are calculated over the data in the store specified.\n",
"stats = client.get_statistics(\n",
" feature_set_id=f'{PROJECT_NAME}/iris', \n",
" feature_set_id='iris', \n",
" store=BIGQUERY_STORE_NAME, \n",
" features=iris_feature_names, \n",
" ingestion_ids=[ingestion_id])"
Expand Down Expand Up @@ -659,7 +655,7 @@
"\n",
"# Compute statistics over the new dataset\n",
"stats_2 = client.get_statistics(\n",
" feature_set_id=f'{PROJECT_NAME}/iris', \n",
" feature_set_id='iris', \n",
" store=BIGQUERY_STORE_NAME, \n",
" features=iris_feature_names, \n",
" ingestion_ids=[ingestion_id_2])\n",
Expand Down Expand Up @@ -691,4 +687,4 @@
},
"nbformat": 4,
"nbformat_minor": 2
}
}
11 changes: 5 additions & 6 deletions sdk/python/feast/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -885,15 +885,14 @@ def get_statistics(
start_date: Optional[datetime.datetime] = None,
end_date: Optional[datetime.datetime] = None,
force_refresh: bool = False,
default_project: Optional[str] = None,
project: Optional[str] = None,
) -> statistics_pb2.DatasetFeatureStatisticsList:
"""
Retrieves the feature featureStatistics computed over the data in the batch
stores.

Args:
feature_set_id: Fully qualified feature set id in the format
project/feature_set to retrieve batch featureStatistics for. If project
feature_set_id: Feature set id to retrieve batch featureStatistics for. If project
is not provided, the default ("default") will be used.
store: Name of the store to retrieve feature featureStatistics over. This
store must be a historical store.
Expand All @@ -913,7 +912,7 @@ def get_statistics(
multiple days, unaggregatable featureStatistics will be dropped.
force_refresh: Setting this flag to true will force a recalculation
of featureStatistics and overwrite results currently in the cache, if any.
default_project: Manual override for default project.
project: Manual override for default project.

Returns:
Returns a tensorflow DatasetFeatureStatisticsList containing TFDV featureStatistics.
Expand All @@ -926,8 +925,8 @@ def get_statistics(
"Only one of dataset_id or [start_date, end_date] can be provided."
)

if default_project != "" and "/" not in feature_set_id:
feature_set_id = f"{default_project}/{feature_set_id}"
if project != "" and "/" not in feature_set_id:
feature_set_id = f"{project}/{feature_set_id}"

request = GetFeatureStatisticsRequest(
feature_set_id=feature_set_id,
Expand Down