Skip to content

Commit

Permalink
Merge pull request getredash#134 from alison985/m6_replay_non_athena
Browse files Browse the repository at this point in the history
adds data_scanned attempt to athenaupstream
  • Loading branch information
alison985 authored Jul 19, 2017
2 parents e8fb6dc + 0b09144 commit b2d4d8b
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion redash/query_runner/athena.py
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,12 @@ def run_query(self, query, user):
column_tuples = [(i[0], _TYPE_MAPPINGS.get(i[1], None)) for i in cursor.description]
columns = self.fetch_columns(column_tuples)
rows = [dict(zip(([c['name'] for c in columns]), r)) for i, r in enumerate(cursor.fetchall())]
data = {'columns': columns, 'rows': rows, 'data_scanned': 'upstream'}
qbytes = 'upstream2'
try:
qbytes = cursor.data_scanned_in_bytes()
except AttributeError as e:
debug("Athena Upstream can't get data_scanned_in_bytes: %s", e)
data = {'columns': columns, 'rows': rows, 'data_scanned': qbytes }
json_data = json.dumps(data, cls=JSONEncoder)
error = None
except KeyboardInterrupt:
Expand Down

0 comments on commit b2d4d8b

Please sign in to comment.