Skip to content

Commit 8d54ae8

Browse files
fix BigQuery test failure for fields with FLOAT or BOOLEAN types by mapping them to equivalent types (BOOL and FLOAT64) (#1003)
Co-authored-by: aghasemi <aghasemi@bol.com>
1 parent ab2bbdd commit 8d54ae8

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1616
- Restrict DuckDB dependency to < 1.4.0 (#972)
1717
- Fixed schema evolution support for optional fields in CSV and Parquet formats. Optional fields marked with `required: false` are no longer incorrectly treated as required during validation, enabling proper schema evolution where optional fields can be added to contracts without breaking validation of historical data files (#977)
1818
- Fixed decimals in pydantic model export. Fields marked with `type: decimal` will be mapped to `decimal.Decimal` instead of `float`.
19+
- Fix BigQuery test failure for fields with FLOAT or BOOLEAN types by mapping them to equivalent types (BOOL and FLOAT64)
1920

2021
## [0.11.2] - 2025-12-15
2122

datacontract/export/bigquery_exporter.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -113,8 +113,8 @@ def map_type_to_bigquery(prop: SchemaProperty) -> str:
113113
# If physicalType is already a BigQuery type, return it directly
114114
if prop.physicalType:
115115
bq_types = {
116-
"STRING", "BYTES", "INT64", "INTEGER", "FLOAT64", "FLOAT", "NUMERIC",
117-
"BIGNUMERIC", "BOOL", "BOOLEAN", "TIMESTAMP", "DATE", "TIME", "DATETIME",
116+
"STRING", "BYTES", "INT64", "INTEGER", "FLOAT64", "NUMERIC",
117+
"BIGNUMERIC", "BOOL", "TIMESTAMP", "DATE", "TIME", "DATETIME",
118118
"GEOGRAPHY", "JSON", "RECORD", "STRUCT", "ARRAY"
119119
}
120120
if prop.physicalType.upper() in bq_types or prop.physicalType.upper().startswith(("STRUCT<", "ARRAY<", "RANGE<")):

0 commit comments

Comments
 (0)