mirror of
https://github.com/apache/superset.git
synced 2024-09-12 08:39:45 -04:00
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:
parent
ff4f9b4527
commit
281ae45495
@ -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"""
|
||||
|
Loading…
Reference in New Issue
Block a user