File tree Expand file tree Collapse file tree 2 files changed +4
-3
lines changed
Expand file tree Collapse file tree 2 files changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -73,7 +73,7 @@ def __init__(
7373 self .status : CommandState = status
7474 self .has_been_closed_server_side : bool = has_been_closed_server_side
7575 self .is_direct_results : bool = is_direct_results
76- self .results : Optional [ResultSetQueue ] = None # Children will set this
76+ self .results : Optional [ResultSetQueue ] = None
7777 self ._is_staging_operation : bool = is_staging_operation
7878 self .lz4_compressed : bool = lz4_compressed
7979 self ._arrow_schema_bytes : Optional [bytes ] = arrow_schema_bytes
@@ -166,7 +166,8 @@ def close(self) -> None:
166166 been closed on the server for some other reason, issue a request to the server to close it.
167167 """
168168 try :
169- self .results .close ()
169+ if self .results :
170+ self .results .close ()
170171 if (
171172 self .status != CommandState .CLOSED
172173 and not self .has_been_closed_server_side
Original file line number Diff line number Diff line change @@ -219,7 +219,7 @@ def test_closing_result_set_hard_closes_commands(self):
219219 mock_results_response = Mock ()
220220 mock_results_response .has_been_closed_server_side = False
221221 mock_connection = Mock ()
222- mock_thrift_backend = Mock ()
222+ mock_thrift_backend = Mock (spec = ThriftDatabricksClient )
223223 mock_results = Mock ()
224224 # Setup session mock on the mock_connection
225225 mock_session = Mock ()
You can’t perform that action at this time.
0 commit comments