Skip to content

Commit 09f0e7e

Browse files
authored
fix: Wrap the bigquery table name with backtick. (feast-dev#3577)
fix: Add escape the table name Signed-off-by: Jiwon Park <bakjeeone@hotmail.com>
1 parent f8d3890 commit 09f0e7e

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

sdk/python/feast/infra/offline_stores/bigquery.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -503,7 +503,7 @@ def to_bigquery(
503503
temp_dest_table = f"{tmp_dest['projectId']}.{tmp_dest['datasetId']}.{tmp_dest['tableId']}"
504504

505505
# persist temp table
506-
sql = f"CREATE TABLE {dest} AS SELECT * FROM {temp_dest_table}"
506+
sql = f"CREATE TABLE `{dest}` AS SELECT * FROM {temp_dest_table}"
507507
self._execute_query(sql, timeout=timeout)
508508

509509
print(f"Done writing to '{dest}'.")
@@ -663,7 +663,7 @@ def _upload_entity_df(
663663
job: Union[bigquery.job.query.QueryJob, bigquery.job.load.LoadJob]
664664

665665
if isinstance(entity_df, str):
666-
job = client.query(f"CREATE TABLE {table_name} AS ({entity_df})")
666+
job = client.query(f"CREATE TABLE `{table_name}` AS ({entity_df})")
667667

668668
elif isinstance(entity_df, pd.DataFrame):
669669
# Drop the index so that we don't have unnecessary columns

0 commit comments

Comments
 (0)