Skip to content

Commit

Permalink
fix: Athena query in debug log (#401)
Browse files Browse the repository at this point in the history
  • Loading branch information
svdimchenko authored Sep 7, 2023
1 parent a9a8696 commit bea619e
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:
query = self.connections._add_query_comment(sql)
conn = self.connections.get_thread_connection()
cursor = conn.handle.cursor()
LOGGER.debug(f"Running Athena query:\n{query}")
try:
cursor.execute(sql, catch_partitions_limit=True)
cursor.execute(query, 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 bea619e

Please sign in to comment.