Skip to content

Commit

Permalink
Used default logger
Browse files Browse the repository at this point in the history
  • Loading branch information
Personal authored and Personal committed Sep 28, 2023
1 parent f56c2e8 commit 81d499a
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions dbt/adapters/athena/connections.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,6 @@
from dbt.adapters.sql import SQLConnectionManager
from dbt.contracts.connection import AdapterResponse, Connection, ConnectionState
from dbt.exceptions import ConnectionError, DbtRuntimeError
from dbt.events import AdapterLogger


logger = AdapterLogger("Athena")


@dataclass
Expand Down Expand Up @@ -118,7 +114,7 @@ def _poll(self, query_id: str) -> AthenaQueryExecution:
query_execution = self.__poll(query_id)
except KeyboardInterrupt as e:
if self._kill_on_interrupt:
logger.warning("Query canceled by user.")
LOGGER.warning("Query canceled by user.")
self._cancel(query_id)
query_execution = self.__poll(query_id)
else:
Expand All @@ -136,7 +132,7 @@ def __poll(self, query_id: str) -> AthenaQueryExecution:
return query_execution
else:
if self.connection.cursor_kwargs.get("debug_query_state", False):
logger.debug(f"Query state is: {query_execution.state}. Sleeping for {self._poll_interval}...")
LOGGER.debug(f"Query state is: {query_execution.state}. Sleeping for {self._poll_interval}...")
time.sleep(self._poll_interval)

def execute( # type: ignore
Expand Down Expand Up @@ -279,7 +275,7 @@ def process_query_stats(cursor: AthenaCursor) -> Tuple[int, int]:
stats = json.loads("{" + query_stats.group(1) + "}")
return stats.get("rowcount", -1), stats.get("data_scanned_in_bytes", 0)
except Exception as err:
logger.debug(f"There was an error parsing query stats {err}")
LOGGER.debug(f"There was an error parsing query stats {err}")
return -1, 0
return cursor.rowcount, cursor.data_scanned_in_bytes

Expand Down

0 comments on commit 81d499a

Please sign in to comment.