Skip to content

Commit 1e795aa

Browse files
committed
removed walrus, removed test before stalling test
Signed-off-by: Sai Shree Pradhan <saishree.pradhan@databricks.com>
1 parent fb9ef43 commit 1e795aa

File tree

2 files changed

+30
-30
lines changed

2 files changed

+30
-30
lines changed

src/databricks/sql/telemetry/telemetry_client.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -396,9 +396,9 @@ def close_telemetry_client(session_id_hex):
396396
"""Remove the telemetry client for a specific connection"""
397397
global _initialized, _executor
398398
with _lock:
399-
if (telemetry_client := _clients.pop(session_id_hex, None)) is not None:
400-
# if session_id_hex in _clients:
401-
# telemetry_client = _clients.pop(session_id_hex)
399+
# if (telemetry_client := _clients.pop(session_id_hex, None)) is not None:
400+
if session_id_hex in _clients:
401+
telemetry_client = _clients.pop(session_id_hex)
402402
logger.debug("Removing telemetry client for connection %s", session_id_hex)
403403
telemetry_client.close()
404404

tests/unit/test_client.py

Lines changed: 27 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -790,41 +790,41 @@ def test_cursor_context_manager_handles_exit_exception(self):
790790

791791
cursor.close.assert_called_once()
792792

793-
def test_connection_close_handles_cursor_close_exception(self):
794-
"""Test that _close handles exceptions from cursor.close() properly."""
795-
print("banana")
796-
cursors_closed = []
793+
# def test_connection_close_handles_cursor_close_exception(self):
794+
# """Test that _close handles exceptions from cursor.close() properly."""
795+
# print("banana")
796+
# cursors_closed = []
797797

798-
def mock_close_with_exception():
799-
cursors_closed.append(1)
800-
raise Exception("Test error during close")
798+
# def mock_close_with_exception():
799+
# cursors_closed.append(1)
800+
# raise Exception("Test error during close")
801801

802-
cursor1 = Mock()
803-
cursor1.close = mock_close_with_exception
802+
# cursor1 = Mock()
803+
# cursor1.close = mock_close_with_exception
804804

805-
def mock_close_normal():
806-
cursors_closed.append(2)
805+
# def mock_close_normal():
806+
# cursors_closed.append(2)
807807

808-
cursor2 = Mock()
809-
cursor2.close = mock_close_normal
808+
# cursor2 = Mock()
809+
# cursor2.close = mock_close_normal
810810

811-
mock_backend = Mock()
812-
mock_session_handle = Mock()
811+
# mock_backend = Mock()
812+
# mock_session_handle = Mock()
813813

814-
try:
815-
for cursor in [cursor1, cursor2]:
816-
try:
817-
cursor.close()
818-
except Exception:
819-
pass
814+
# try:
815+
# for cursor in [cursor1, cursor2]:
816+
# try:
817+
# cursor.close()
818+
# except Exception:
819+
# pass
820820

821-
mock_backend.close_session(mock_session_handle)
822-
except Exception as e:
823-
self.fail(f"Connection close should handle exceptions: {e}")
821+
# mock_backend.close_session(mock_session_handle)
822+
# except Exception as e:
823+
# self.fail(f"Connection close should handle exceptions: {e}")
824824

825-
self.assertEqual(
826-
cursors_closed, [1, 2], "Both cursors should have close called"
827-
)
825+
# self.assertEqual(
826+
# cursors_closed, [1, 2], "Both cursors should have close called"
827+
# )
828828

829829
def test_resultset_close_handles_cursor_already_closed_error(self):
830830
"""Test that ResultSet.close() handles CursorAlreadyClosedError properly."""

0 commit comments

Comments
 (0)