Skip to content

Commit 59b4825

Browse files
remove duplicate test, correct active_command_id attribute
Signed-off-by: varun-edachali-dbx <varun.edachali@databricks.com>
1 parent cbf63f9 commit 59b4825

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
@@ -1078,7 +1078,7 @@ def cancel(self) -> None:
10781078
def close(self) -> None:
10791079
"""Close cursor"""
10801080
self.open = False
1081-
self.active_op_handle = None
1081+
self.active_command_id = None
10821082
if self.active_result_set:
10831083
self._close_and_clear_active_result_set()
10841084

tests/unit/test_client.py

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -271,21 +271,6 @@ def test_context_manager_closes_cursor(self):
271271
cursor.close = mock_close
272272
mock_close.assert_called_once_with()
273273

274-
@patch("%s.client.ThriftBackend" % PACKAGE_NAME)
275-
def test_context_manager_closes_connection(self, mock_client_class):
276-
instance = mock_client_class.return_value
277-
278-
mock_open_session_resp = MagicMock(spec=TOpenSessionResp)()
279-
mock_open_session_resp.sessionHandle.sessionId = b"\x22"
280-
instance.open_session.return_value = mock_open_session_resp
281-
282-
with databricks.sql.connect(**self.DUMMY_CONNECTION_ARGS) as connection:
283-
pass
284-
285-
# Check the close session request has an id of x22
286-
close_session_id = instance.close_session.call_args[0][0].sessionId
287-
self.assertEqual(close_session_id, b"\x22")
288-
289274
def dict_product(self, dicts):
290275
"""
291276
Generate cartesion product of values in input dictionary, outputting a dictionary

0 commit comments

Comments
 (0)