Skip to content

Commit

Permalink
fix: Wrap the bigquery table name with backtick. (#3577)
Browse files Browse the repository at this point in the history
fix: Add escape the table name

Signed-off-by: Jiwon Park <bakjeeone@hotmail.com>
  • Loading branch information
phil-park authored Apr 3, 2023
1 parent f8d3890 commit 09f0e7e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions sdk/python/feast/infra/offline_stores/bigquery.py
Original file line number Diff line number Diff line change
Expand Up @@ -503,7 +503,7 @@ def to_bigquery(
temp_dest_table = f"{tmp_dest['projectId']}.{tmp_dest['datasetId']}.{tmp_dest['tableId']}"

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

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

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

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

0 comments on commit 09f0e7e

Please sign in to comment.