Skip to content

Commit bca7c56

Browse files
Linchinchalmerlowe
authored andcommitted
fix: add default value in SchemaField.from_api_repr() (#2115)
1 parent 7fb624b commit bca7c56

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

google/cloud/bigquery/schema.py

+6
Original file line numberDiff line numberDiff line change
@@ -228,6 +228,12 @@ def from_api_repr(cls, api_repr: dict) -> "SchemaField":
228228
# fields. See https://github.com/googleapis/python-bigquery/issues/6
229229
placeholder._properties = api_repr
230230

231+
# Add the field `mode` with default value if it does not exist. Fixes
232+
# an incompatibility issue with pandas-gbq:
233+
# https://github.com/googleapis/python-bigquery-pandas/issues/854
234+
if "mode" not in placeholder._properties:
235+
placeholder._properties["mode"] = "NULLABLE"
236+
231237
return placeholder
232238

233239
@property

0 commit comments

Comments
 (0)