Skip to content

Commit 61dfc4d

Browse files
set active_command_id to None, not active_op_handle
Signed-off-by: varun-edachali-dbx <[email protected]>
1 parent 9fb6a76 commit 61dfc4d

File tree

2 files changed

+1
-16
lines changed

2 files changed

+1
-16
lines changed

src/databricks/sql/client.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1079,7 +1079,7 @@ def cancel(self) -> None:
10791079
def close(self) -> None:
10801080
"""Close cursor"""
10811081
self.open = False
1082-
self.active_op_handle = None
1082+
self.active_command_id = None
10831083
if self.active_result_set:
10841084
self._close_and_clear_active_result_set()
10851085

tests/unit/test_client.py

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -260,21 +260,6 @@ def test_context_manager_closes_cursor(self):
260260
cursor.close = mock_close
261261
mock_close.assert_called_once_with()
262262

263-
@patch("%s.client.ThriftBackend" % PACKAGE_NAME)
264-
def test_context_manager_closes_connection(self, mock_client_class):
265-
instance = mock_client_class.return_value
266-
267-
mock_open_session_resp = MagicMock(spec=TOpenSessionResp)()
268-
mock_open_session_resp.sessionHandle.sessionId = b"\x22"
269-
instance.open_session.return_value = mock_open_session_resp
270-
271-
with databricks.sql.connect(**self.DUMMY_CONNECTION_ARGS) as connection:
272-
pass
273-
274-
# Check the close session request has an id of x22
275-
close_session_id = instance.close_session.call_args[0][0].sessionId
276-
self.assertEqual(close_session_id, b"\x22")
277-
278263
def dict_product(self, dicts):
279264
"""
280265
Generate cartesion product of values in input dictionary, outputting a dictionary

0 commit comments

Comments
 (0)