From 40ea39d4a836c56d862213416df32c8614c448b7 Mon Sep 17 00:00:00 2001 From: mxmzdlv Date: Mon, 12 Feb 2018 21:16:42 -0800 Subject: [PATCH] Check class name string instead of checking the instance (#4404) 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