Skip to content

Commit 3a4ad83

Browse files
committed
Add AthenaQueryError exception.
1 parent 713a5fe commit 3a4ad83

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

awswrangler/exceptions.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,5 +22,9 @@ class RedshiftLoadError(Exception):
2222
pass
2323

2424

25+
class AthenaQueryError(Exception):
26+
pass
27+
28+
2529
class MissingBatchDetected(Exception):
2630
pass

awswrangler/pandas.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
import pyarrow
88
from pyarrow import parquet
99

10-
from awswrangler.exceptions import UnsupportedWriteMode, UnsupportedFileFormat
10+
from awswrangler.exceptions import UnsupportedWriteMode, UnsupportedFileFormat, AthenaQueryError
1111
from awswrangler.utils import calculate_bounders
1212
from awswrangler import s3
1313

@@ -89,7 +89,7 @@ def read_sql_athena(self, sql, database, s3_output=None):
8989
reason = (query_response.get("QueryExecution").get("Status").get(
9090
"StateChangeReason"))
9191
message_error = f"Query error: {reason}"
92-
raise Exception(message_error)
92+
raise AthenaQueryError(message_error)
9393
else:
9494
path = f"{s3_output}{query_execution_id}.csv"
9595
dataframe = self.read_csv(path=path)

0 commit comments

Comments
 (0)