Skip to content

New Standard SQL Data Types Not Supported in gcloud._helpers._rows_from_json() / _CELLDATA_FROM_JSON() #2229

@KevinTydlacka

Description

@KevinTydlacka

Standard SQL dialect support was added in 0.18.0, but current release does not support queries that return results that include data types that are not supported by Legacy SQL.

E.g. executing the following query using Standard SQL:

SELECT PARSE_DATE('%Y%m%d', '20160810') AS table_date;

results in

rows = query.rows
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/gcloud/bigquery/query.py", line 204, in rows
    return _rows_from_json(self._properties.get('rows', ()), self.schema)
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/gcloud/bigquery/_helpers.py", line 85, in _rows_
from_json
    converter = _CELLDATA_FROM_JSON[field.field_type]
KeyError: u'DATE'

Not a significant issue since the Legacy SQL Data types will work for my needs, but wanted to report it all the same.

Metadata

Metadata

Assignees

Labels

api: bigqueryIssues related to the BigQuery API.type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions