Fix for SQL editor throwing can't deserialize google.cloud.bigquery._helpers.Row with BigQuery (#4071)

* fix for SQL editor throwing cant deserialize google.cloud.bigquery._helpers.Row with BigQuery

* linted code

* disable pylint import error of bigquery row

* fixed spacing issue before inline-comment
This commit is contained in:
kuriancheeramelil 2017-12-19 10:52:34 +05:30 committed by Maxime Beauchemin
parent ff4f9b4527
commit 281ae45495

View File

@ -1186,6 +1186,14 @@ class BQEngineSpec(BaseEngineSpec):
return "{}'".format(dttm.strftime('%Y-%m-%d'))
return "'{}'".format(dttm.strftime('%Y-%m-%d %H:%M:%S'))
@classmethod
def fetch_data(cls, cursor, limit):
data = super(BQEngineSpec, cls).fetch_data(cursor, limit)
from google.cloud.bigquery._helpers import Row # pylint: disable=import-error
if len(data) != 0 and isinstance(data[0], Row):
data = [r.values() for r in data]
return data
class ImpalaEngineSpec(BaseEngineSpec):
"""Engine spec for Cloudera's Impala"""