Skip to content

Commit e178b90

Browse files
committed
Handling new Athena exception.
1 parent adb1319 commit e178b90

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

awswrangler/athena/_read.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -365,6 +365,10 @@ def _resolve_query_without_cache_ctas(
365365
)
366366
except botocore.exceptions.ClientError as ex:
367367
error: Dict[str, Any] = ex.response["Error"]
368+
if error["Code"] == "InvalidRequestException" and "Exception parsing query" in error["Message"]:
369+
raise exceptions.InvalidCtasApproachQuery(
370+
"Is not possible to wrap this query into a CTAS statement. Please use ctas_approach=False."
371+
)
368372
if error["Code"] == "InvalidRequestException" and "extraneous input" in error["Message"]:
369373
raise exceptions.InvalidCtasApproachQuery(
370374
"Is not possible to wrap this query into a CTAS statement. Please use ctas_approach=False."

0 commit comments

Comments
 (0)