Skip to content

Commit c9c8793

Browse files
committed
get telemetry client
Signed-off-by: Sai Shree Pradhan <saishree.pradhan@databricks.com>
1 parent 341991d commit c9c8793

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

src/databricks/sql/telemetry/telemetry_client.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -401,11 +401,9 @@ def initialize_telemetry_client(
401401
@staticmethod
402402
def get_telemetry_client(session_id_hex):
403403
"""Get the telemetry client for a specific connection"""
404-
try:
405-
return TelemetryClientFactory._clients[session_id_hex]
406-
except Exception as e:
407-
logger.debug("Failed to get telemetry client: %s", e)
408-
return NoopTelemetryClient()
404+
return TelemetryClientFactory._clients.get(
405+
session_id_hex, NoopTelemetryClient()
406+
)
409407

410408
@staticmethod
411409
def close(session_id_hex):

0 commit comments

Comments
 (0)