From 1c010357affd48616d39f1ad01b872fac946269d Mon Sep 17 00:00:00 2001 From: Harry Date: Thu, 13 Jul 2023 13:07:41 +0700 Subject: [PATCH] fix: Optimize bytes processed when retrieving entity df schema to 0 (#3680) feat: Optimize bytes processed when retrieving entity df schema to 0 Signed-off-by: Hai Nguyen --- sdk/python/feast/infra/offline_stores/bigquery.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sdk/python/feast/infra/offline_stores/bigquery.py b/sdk/python/feast/infra/offline_stores/bigquery.py index 47335c411f..5dd8f61bce 100644 --- a/sdk/python/feast/infra/offline_stores/bigquery.py +++ b/sdk/python/feast/infra/offline_stores/bigquery.py @@ -693,7 +693,7 @@ def _get_entity_schema( ) -> Dict[str, np.dtype]: if isinstance(entity_df, str): entity_df_sample = ( - client.query(f"SELECT * FROM ({entity_df}) LIMIT 1").result().to_dataframe() + client.query(f"SELECT * FROM ({entity_df}) LIMIT 0").result().to_dataframe() ) entity_schema = dict(zip(entity_df_sample.columns, entity_df_sample.dtypes))