From 281ae4549518eeb659baa82e277fd0045419a340 Mon Sep 17 00:00:00 2001 From: kuriancheeramelil Date: Tue, 19 Dec 2017 10:52:34 +0530 Subject: [PATCH] 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 --- superset/db_engine_specs.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/superset/db_engine_specs.py b/superset/db_engine_specs.py index a176a25b3c1fb..fbda059a9ae39 100644 --- a/superset/db_engine_specs.py +++ b/superset/db_engine_specs.py @@ -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"""