Skip to content

Commit bedfc06

Browse files
committed
simplify changes
1 parent c78bace commit bedfc06

File tree

3 files changed

+8
-5
lines changed

3 files changed

+8
-5
lines changed

src/databricks/sql/auth/thrift_http_client.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,7 @@ def startRetryTimer(self):
112112
self.retry_policy and self.retry_policy.start_retry_timer()
113113

114114
def open(self):
115+
115116
# self.__pool replaces the self.__http used by the original THttpClient
116117
_pool_kwargs = {"maxsize": self.max_connections}
117118

src/databricks/sql/backend/sea/backend.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -285,6 +285,8 @@ def close_session(self, session_id: SessionId) -> None:
285285
OperationalError: If there's an error closing the session
286286
"""
287287

288+
logger.debug("SeaDatabricksClient.close_session(session_id=%s)", session_id)
289+
288290
sea_session_id = session_id.to_sea_session_id()
289291
if sea_session_id is None:
290292
raise ValueError("Not a valid SEA session ID")

src/databricks/sql/telemetry/telemetry_client.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -364,7 +364,7 @@ def export_latency_log(self, latency_ms, sql_execution_event, sql_statement_id):
364364
)
365365

366366
def close(self):
367-
"""Schedules the client to be closed in the background."""
367+
"""Schedules client closure."""
368368
logger.debug(
369369
"Scheduling background closure for TelemetryClient of connection %s",
370370
self._session_id_hex,
@@ -376,14 +376,14 @@ def _close_and_wait(self):
376376
self._flush()
377377

378378
with self._lock:
379-
futures_to_wait_on = list(self._pending_futures)
379+
pending_events = list(self._pending_futures)
380380

381-
if futures_to_wait_on:
381+
if pending_events:
382382
logger.debug(
383383
"Waiting for %s pending telemetry requests to complete.",
384-
len(futures_to_wait_on),
384+
len(pending_events),
385385
)
386-
wait(futures_to_wait_on)
386+
wait(pending_events)
387387

388388
self._http_client.close()
389389

0 commit comments

Comments
 (0)