Skip to content

Commit

Permalink
Merge pull request getredash#1841 from laughingman7743/fix_query_canc…
Browse files Browse the repository at this point in the history
…ellation_condition

Fix query cancellation condition for Athena query runner
  • Loading branch information
arikfr authored Jun 25, 2017
2 parents 9816403 + df945a1 commit 090962d
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions redash/query_runner/athena.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,11 +130,13 @@ def run_query(self, query, user):
json_data = json.dumps(data, cls=JSONEncoder)
error = None
except KeyboardInterrupt:
cursor.cancel()
if cursor.query_id:
cursor.cancel()
error = "Query cancelled by user."
json_data = None
except Exception, ex:
cursor.cancel()
if cursor.query_id:
cursor.cancel()
error = ex.message
json_data = None

Expand Down

0 comments on commit 090962d

Please sign in to comment.