Skip to content

Commit 82b74a5

Browse files
committed
fix: Apply Black formatting
1 parent 91012ad commit 82b74a5

File tree

1 file changed

+17
-19
lines changed

1 file changed

+17
-19
lines changed

src/databricks/sql/telemetry/telemetry_client.py

Lines changed: 17 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -192,9 +192,7 @@ def __init__(
192192

193193
# OPTIMIZATION: Use lock-free Queue instead of list + lock
194194
# Queue is thread-safe internally and has better performance under concurrency
195-
self._events_queue: Queue[TelemetryFrontendLog] = Queue(
196-
maxsize=batch_size * 2
197-
)
195+
self._events_queue: Queue[TelemetryFrontendLog] = Queue(maxsize=batch_size * 2)
198196

199197
self._driver_connection_params = None
200198
self._host_url = host_url
@@ -417,9 +415,9 @@ class TelemetryClientFactory:
417415
It uses a thread pool to handle asynchronous operations and a single flush thread for all clients.
418416
"""
419417

420-
_clients: Dict[
421-
str, BaseTelemetryClient
422-
] = {} # Map of session_id_hex -> BaseTelemetryClient
418+
_clients: Dict[str, BaseTelemetryClient] = (
419+
{}
420+
) # Map of session_id_hex -> BaseTelemetryClient
423421
_executor: Optional[ThreadPoolExecutor] = None
424422
_initialized: bool = False
425423
_lock = threading.RLock() # Thread safety for factory operations
@@ -520,21 +518,21 @@ def initialize_telemetry_client(
520518
session_id_hex,
521519
)
522520
if telemetry_enabled:
523-
TelemetryClientFactory._clients[
524-
session_id_hex
525-
] = TelemetryClient(
526-
telemetry_enabled=telemetry_enabled,
527-
session_id_hex=session_id_hex,
528-
auth_provider=auth_provider,
529-
host_url=host_url,
530-
executor=TelemetryClientFactory._executor,
531-
batch_size=batch_size,
532-
client_context=client_context,
521+
TelemetryClientFactory._clients[session_id_hex] = (
522+
TelemetryClient(
523+
telemetry_enabled=telemetry_enabled,
524+
session_id_hex=session_id_hex,
525+
auth_provider=auth_provider,
526+
host_url=host_url,
527+
executor=TelemetryClientFactory._executor,
528+
batch_size=batch_size,
529+
client_context=client_context,
530+
)
533531
)
534532
else:
535-
TelemetryClientFactory._clients[
536-
session_id_hex
537-
] = NoopTelemetryClient()
533+
TelemetryClientFactory._clients[session_id_hex] = (
534+
NoopTelemetryClient()
535+
)
538536
except Exception as e:
539537
logger.debug("Failed to initialize telemetry client: %s", e)
540538
# Fallback to NoopTelemetryClient to ensure connection doesn't fail

0 commit comments

Comments
 (0)