better exception info

This commit is contained in:
Ari Brown 2023-08-23 08:12:01 -04:00
parent 209f32a7de
commit 383185e6cb

View file

@ -29,7 +29,6 @@ class Athena:
e.run()
return e
class Execute:
"""
Execute will not return results, but will execute the SQL and return the final state.
@ -42,7 +41,7 @@ class Execute:
self.sql = sql
self.params = [str(p) for p in params]
self.info_cache = None
self.files = []
self.temps = []
# The string of the query
def query(self):
@ -116,7 +115,7 @@ class Query(Execute):
else:
print("Error")
print(self.info_cache['Status']['AthenaError']['ErrorMessage'])
raise
raise Exception(self.info_cache['Status']['AthenaError']['ErrorMessage'])
#return status # canceled or error
# Blocks until the query has finished running and then returns you a pyarrow