Skip to content
This repository was archived by the owner on Mar 6, 2026. It is now read-only.

Commit a3dcf28

Browse files
committed
fix unit 3.9
1 parent 8075ce5 commit a3dcf28

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

google/cloud/bigquery/_pandas_helpers.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -540,6 +540,15 @@ def dataframe_to_bq_schema(dataframe, bq_schema):
540540

541541
unknown_type_columns.append(column)
542542

543+
# Catch any schema mismatch. The developer explicitly asked to serialize a
544+
# column, but it was not found.
545+
if bq_schema_unused:
546+
raise ValueError(
547+
"bq_schema contains fields not present in dataframe: {}".format(
548+
bq_schema_unused
549+
)
550+
)
551+
543552
if unknown_type_columns != []:
544553
msg = "Could not determine the type of columns: {}".format(
545554
", ".join(unknown_type_columns)

0 commit comments

Comments
 (0)