You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Create table with record field containing a JSON subfield
Query record field and try to read row from query result
Code example
fromgoogle.cloudimportbigquerybigquery.Client().query("SELECT record_with_json_subfield.* FROM <table>").result().__next__()
Stack trace
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "<stdin>", line 1, in <listcomp>
File "lib/python3.9/site-packages/google/api_core/page_iterator.py", line 209, in _items_iter
for item in page:
File "lib/python3.9/site-packages/google/api_core/page_iterator.py", line 131, in __next__
result = self._item_to_value(self._parent, item)
File "lib/python3.9/site-packages/google/cloud/bigquery/table.py", line 2710, in _item_to_row
_helpers._row_tuple_from_json(resource, iterator.schema),
File "lib/python3.9/site-packages/google/cloud/bigquery/_helpers.py", line 435, in _row_tuple_from_json
row_data.append(_field_from_json(cell["v"], field))
File "lib/python3.9/site-packages/google/cloud/bigquery/_helpers.py", line 411, in _field_from_json
return converter(resource, field)
File "lib/python3.9/site-packages/google/cloud/bigquery/_helpers.py", line 368, in _record_from_json
converter = _CELLDATA_FROM_JSON[subfield.field_type]
KeyError: 'JSON'
Environment details
google-cloud-bigqueryversion: 3.5.0Steps to reproduce
Code example
Stack trace