mirror of
https://github.com/getredash/redash.git
synced 2025-12-25 01:03:20 -05:00
Merge pull request #2005 from getredash/patches
Fix: TreasureData queries were failing when returning 0 rows.
This commit is contained in:
@@ -110,7 +110,10 @@ class TreasureData(BaseQueryRunner):
|
||||
'friendly_name': col[0],
|
||||
'type': TD_TYPES_MAPPING.get(col[1], None)} for col in columns_data]
|
||||
|
||||
rows = [dict(zip(([c[0] for c in columns_data]), r)) for i, r in enumerate(cursor.fetchall())]
|
||||
if cursor.rowcount == 0:
|
||||
rows = []
|
||||
else:
|
||||
rows = [dict(zip(([c[0] for c in columns_data]), r)) for i, r in enumerate(cursor.fetchall())]
|
||||
data = {'columns': columns, 'rows': rows}
|
||||
json_data = json.dumps(data, cls=JSONEncoder)
|
||||
error = None
|
||||
|
||||
Reference in New Issue
Block a user