Skip to content

Commit 53db85d

Browse files
committed
public functions defined at interface level
Signed-off-by: Sai Shree Pradhan <saishree.pradhan@databricks.com>
1 parent bed4c77 commit 53db85d

File tree

1 file changed

+16
-3
lines changed

1 file changed

+16
-3
lines changed

src/databricks/sql/telemetry/telemetry_client.py

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,14 @@ class BaseTelemetryClient(ABC):
102102
It is used to define the interface for telemetry clients.
103103
"""
104104

105+
@abstractmethod
106+
def export_event(self, event):
107+
pass
108+
109+
@abstractmethod
110+
def flush(self):
111+
pass
112+
105113
@abstractmethod
106114
def export_initial_telemetry_log(self, driver_connection_params, user_agent):
107115
pass
@@ -128,6 +136,12 @@ def __new__(cls):
128136
cls._instance = super(NoopTelemetryClient, cls).__new__(cls)
129137
return cls._instance
130138

139+
def export_event(self, event):
140+
pass
141+
142+
def flush(self):
143+
pass
144+
131145
def export_initial_telemetry_log(self, driver_connection_params, user_agent):
132146
pass
133147

@@ -354,9 +368,8 @@ def _handle_unhandled_exception(cls, exc_type, exc_value, exc_traceback):
354368
logger.debug(
355369
"Flushing pending telemetry and waiting for thread pool completion..."
356370
)
357-
for uuid, client in cls._clients.items():
358-
if hasattr(client, "flush"):
359-
client.flush() # Submit any pending events
371+
for client in cls._clients.items():
372+
client.flush() # Submit any pending events
360373

361374
if cls._executor:
362375
try:

0 commit comments

Comments
 (0)