From 7004e45e76a23c6bfe1f9e9821e30a45d9572127 Mon Sep 17 00:00:00 2001 From: Maxim Zudilov Date: Mon, 12 Feb 2018 12:04:37 +1300 Subject: [PATCH] Check class name string instead of checking the instance This fixes an issue with the newer Google's DBAPI library, which moved Row from google.cloud.bigquery._helper.Row to google.cloud.bigquery.Row, causing ImportError --- superset/db_engine_specs.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/superset/db_engine_specs.py b/superset/db_engine_specs.py index b961c03152a6c..f0e7c67620712 100644 --- a/superset/db_engine_specs.py +++ b/superset/db_engine_specs.py @@ -1200,8 +1200,7 @@ def convert_dttm(cls, target_type, dttm): @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): + if len(data) != 0 and type(data[0]).__name__ == 'Row': data = [r.values() for r in data] return data