Skip to content

Commit

Permalink
Remove support for dict type, add helpful exception message (#1068)
Browse files Browse the repository at this point in the history
  • Loading branch information
austinweisgrau authored Jul 11, 2024
1 parent 27bdb71 commit d9a1faa
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion parsons/google/google_bigquery.py
Original file line number Diff line number Diff line change
Expand Up @@ -1199,7 +1199,14 @@ def _generate_schema_from_parsons_table(self, tbl):
if isinstance(value, datetime.datetime) and value.tzinfo:
best_type = "timestamp"

field_type = self._bigquery_type(best_type)
try:
field_type = self._bigquery_type(best_type)
except KeyError as e:
raise KeyError(
"Column type not supported for load to BigQuery. "
"Consider converting to another type. "
f"[type={best_type}]"
) from e
field = bigquery.schema.SchemaField(stat["name"], field_type)
fields.append(field)
return fields
Expand Down

0 comments on commit d9a1faa

Please sign in to comment.