Skip to content

Commit

Permalink
Returned Athena query debug
Browse files Browse the repository at this point in the history
  • Loading branch information
svdimchenko committed Sep 7, 2023
1 parent a9a8696 commit 6be2037
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion dbt/adapters/athena/impl.py
Original file line number Diff line number Diff line change
Expand Up @@ -949,10 +949,12 @@ def _get_table_input(table: TableTypeDef) -> TableInputTypeDef:

@available
def run_query_with_partitions_limit_catching(self, sql: str) -> str:
sql = self.connections._add_query_comment(sql)
conn = self.connections.get_thread_connection()
cursor = conn.handle.cursor()
LOGGER.debug(f"Running Athena query:\n{sql}")
try:
cursor.execute(sql, catch_partitions_limit=True)
conn.execute(sql, catch_partitions_limit=True)
except OperationalError as e:
LOGGER.debug(f"CAUGHT EXCEPTION: {e}")
if "TOO_MANY_OPEN_PARTITIONS" in str(e):
Expand Down

0 comments on commit 6be2037

Please sign in to comment.