Skip to content

Commit 94e67f7

Browse files
committed
small fixes
Signed-off-by: Sai Shree Pradhan <[email protected]>
1 parent 12ff47d commit 94e67f7

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/databricks/sql/telemetry/telemetry_client.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -429,7 +429,7 @@ def close(session_id_hex):
429429
)
430430
try:
431431
TelemetryClientFactory._executor.shutdown(wait=True)
432-
TelemetryHttpClient.get_instance().close()
432+
TelemetryHttpClient.close()
433433
except Exception as e:
434434
logger.debug("Failed to shutdown thread pool executor: %s", e)
435435
TelemetryClientFactory._executor = None

tests/e2e/test_telemetry_retry.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ def get_client(self, session_id, num_retries=3):
6161
)
6262
adapter = client._http_client.session.adapters.get("https://")
6363
adapter.max_retries = retry_policy
64-
return client, adapter
64+
return client
6565

6666
@pytest.mark.parametrize(
6767
"status_code, description",
@@ -77,7 +77,7 @@ def test_non_retryable_status_codes_are_not_retried(self, status_code, descripti
7777
Verifies that terminal error codes (401, 403, 501) and success codes (200) are not retried.
7878
"""
7979
# Use the status code in the session ID for easier debugging if it fails
80-
client, _ = self.get_client(f"session-{status_code}")
80+
client = self.get_client(f"session-{status_code}")
8181
mock_responses = [{"status": status_code}]
8282

8383
with patch(PATCH_TARGET, return_value=create_mock_conn(mock_responses)) as mock_get_conn:
@@ -94,7 +94,7 @@ def test_exceeds_retry_count_limit(self):
9494
num_retries = 3
9595
expected_total_calls = num_retries + 1
9696
retry_after = 1
97-
client, _ = self.get_client("session-exceed-limit", num_retries=num_retries)
97+
client = self.get_client("session-exceed-limit", num_retries=num_retries)
9898
mock_responses = [{"status": 503, "headers": {"Retry-After": str(retry_after)}}, {"status": 429}, {"status": 502}, {"status": 503}]
9999

100100
with patch(PATCH_TARGET, return_value=create_mock_conn(mock_responses)) as mock_get_conn:

0 commit comments

Comments
 (0)