From 49d647de52994e2cbb2374cfba90c81d6b94cac7 Mon Sep 17 00:00:00 2001 From: Jiwon Park Date: Wed, 17 May 2023 07:57:06 +0900 Subject: [PATCH 1/2] fix: Fix scan datasize to 0 for inference schema Signed-off-by: Jiwon Park --- sdk/python/feast/infra/offline_stores/bigquery_source.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sdk/python/feast/infra/offline_stores/bigquery_source.py b/sdk/python/feast/infra/offline_stores/bigquery_source.py index 536dbc5c141..af57f5ab015 100644 --- a/sdk/python/feast/infra/offline_stores/bigquery_source.py +++ b/sdk/python/feast/infra/offline_stores/bigquery_source.py @@ -180,7 +180,7 @@ def get_table_column_names_and_types( if not isinstance(schema[0], bigquery.schema.SchemaField): raise TypeError("Could not parse BigQuery table schema.") else: - bq_columns_query = f"SELECT * FROM ({self.query}) LIMIT 1" + bq_columns_query = f"SELECT * FROM ({self.query}) LIMIT 0" queryRes = client.query(bq_columns_query).result() schema = queryRes.schema From 11d931f17bfc78b79622796ab470c2f01c3fb373 Mon Sep 17 00:00:00 2001 From: Jiwon Park Date: Wed, 17 May 2023 07:57:26 +0900 Subject: [PATCH 2/2] style: Rename queryRes to snake case Signed-off-by: Jiwon Park --- sdk/python/feast/infra/offline_stores/bigquery_source.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sdk/python/feast/infra/offline_stores/bigquery_source.py b/sdk/python/feast/infra/offline_stores/bigquery_source.py index af57f5ab015..4888707c09c 100644 --- a/sdk/python/feast/infra/offline_stores/bigquery_source.py +++ b/sdk/python/feast/infra/offline_stores/bigquery_source.py @@ -181,8 +181,8 @@ def get_table_column_names_and_types( raise TypeError("Could not parse BigQuery table schema.") else: bq_columns_query = f"SELECT * FROM ({self.query}) LIMIT 0" - queryRes = client.query(bq_columns_query).result() - schema = queryRes.schema + query_res = client.query(bq_columns_query).result() + schema = query_res.schema name_type_pairs: List[Tuple[str, str]] = [] for field in schema: