Skip to content

Commit

Permalink
Fix for SQL editor throwing can't deserialize google.cloud.bigquery._…
Browse files Browse the repository at this point in the history
…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
  • Loading branch information
kuriancheeramelil authored and mistercrunch committed Dec 19, 2017
1 parent ff4f9b4 commit 281ae45
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions superset/db_engine_specs.py
Original file line number Diff line number Diff line change
Expand Up @@ -1186,6 +1186,14 @@ def convert_dttm(cls, target_type, dttm):
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"""
Expand Down

0 comments on commit 281ae45

Please sign in to comment.