Skip to content

Commit 7d85fb8

Browse files
authored
fix(util): Have import_google_sheet() redeploy the table schema to add back field descriptions. (#8442)
1 parent 939c6a7 commit 7d85fb8

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

bigquery_etl/util/google_sheets.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,3 +107,11 @@ def import_google_sheet(
107107
print(
108108
f"Imported {result.total_rows} rows from {sheet_url} into `{destination_table}`."
109109
)
110+
111+
# Redeploy the table schema to add back field descriptions, which get removed when overwriting the table.
112+
client.update_table(
113+
bigquery.Table(
114+
destination_table, schema=destination_schema.to_bigquery_schema()
115+
),
116+
fields=["schema"],
117+
)

0 commit comments

Comments
 (0)