Skip to content

Commit bed4c77

Browse files
committed
removed unnecassary class variable and a redundant try/except block
Signed-off-by: Sai Shree Pradhan <saishree.pradhan@databricks.com>
1 parent 34b1600 commit bed4c77

File tree

2 files changed

+3
-9
lines changed

2 files changed

+3
-9
lines changed

src/databricks/sql/exc.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,11 @@ def __init__(
1919
super().__init__(message, *args, **kwargs)
2020
self.message = message
2121
self.context = context or {}
22-
self.connection_uuid = connection_uuid
2322

2423
error_name = self.__class__.__name__
25-
if self.connection_uuid:
24+
if connection_uuid:
2625
telemetry_client = TelemetryClientFactory.get_telemetry_client(
27-
self.connection_uuid
26+
connection_uuid
2827
)
2928
telemetry_client.export_failure_log(error_name, self.message)
3029

src/databricks/sql/telemetry/telemetry_client.py

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -356,12 +356,7 @@ def _handle_unhandled_exception(cls, exc_type, exc_value, exc_traceback):
356356
)
357357
for uuid, client in cls._clients.items():
358358
if hasattr(client, "flush"):
359-
try:
360-
client.flush() # Submit any pending events
361-
except Exception as e:
362-
logger.debug(
363-
"Failed to flush telemetry for connection %s: %s", uuid, e
364-
)
359+
client.flush() # Submit any pending events
365360

366361
if cls._executor:
367362
try:

0 commit comments

Comments
 (0)