Skip to content

Commit

Permalink
Check class name string instead of checking the instance (apache#4404)
Browse files Browse the repository at this point in the history
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
  • Loading branch information
mxmzdlv authored and mistercrunch committed Feb 13, 2018
1 parent 100b2e3 commit 40ea39d
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions superset/db_engine_specs.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit 40ea39d

Please sign in to comment.