@@ -619,13 +619,6 @@ def test_handle_execute_response_sets_compression_in_direct_results(
619619 lz4Compressed = Mock ()
620620 resultSet = MagicMock ()
621621 resultSet .results .startRowOffset = 0
622-
623- # Create a valid operation status
624- op_status = ttypes .TGetOperationStatusResp (
625- status = self .okay_status ,
626- operationState = ttypes .TOperationState .FINISHED_STATE ,
627- )
628-
629622 t_execute_resp = resp_type (
630623 status = Mock (),
631624 operationHandle = Mock (),
@@ -927,9 +920,7 @@ def test_handle_execute_response_can_handle_with_direct_results(self):
927920 auth_provider = AuthProvider (),
928921 ssl_options = SSLOptions (),
929922 )
930- thrift_backend ._results_message_to_execute_response = Mock (
931- return_value = (Mock (), Mock ())
932- )
923+ thrift_backend ._results_message_to_execute_response = Mock ()
933924
934925 thrift_backend ._handle_execute_response (execute_resp , Mock ())
935926
@@ -957,12 +948,6 @@ def test_use_arrow_schema_if_available(self, tcli_service_class):
957948 operationHandle = self .operation_handle ,
958949 )
959950
960- # Mock the operation status response
961- op_state = ttypes .TGetOperationStatusResp (
962- status = self .okay_status ,
963- operationState = ttypes .TOperationState .FINISHED_STATE ,
964- )
965- tcli_service_instance .GetOperationStatus .return_value = op_state
966951 tcli_service_instance .GetResultSetMetadata .return_value = (
967952 t_get_result_set_metadata_resp
968953 )
@@ -977,7 +962,7 @@ def test_use_arrow_schema_if_available(self, tcli_service_class):
977962 t_execute_resp , Mock ()
978963 )
979964
980- self .assertEqual (arrow_schema_bytes , arrow_schema_mock )
965+ self .assertEqual (execute_response . arrow_schema_bytes , arrow_schema_mock )
981966
982967 @patch ("databricks.sql.backend.thrift_backend.TCLIService.Client" , autospec = True )
983968 def test_fall_back_to_hive_schema_if_no_arrow_schema (self , tcli_service_class ):
@@ -997,12 +982,6 @@ def test_fall_back_to_hive_schema_if_no_arrow_schema(self, tcli_service_class):
997982 operationHandle = self .operation_handle ,
998983 )
999984
1000- # Mock the operation status response
1001- op_state = ttypes .TGetOperationStatusResp (
1002- status = self .okay_status ,
1003- operationState = ttypes .TOperationState .FINISHED_STATE ,
1004- )
1005- tcli_service_instance .GetOperationStatus .return_value = op_state
1006985 tcli_service_instance .GetResultSetMetadata .return_value = hive_schema_req
1007986 tcli_service_instance .GetOperationStatus .return_value = (
1008987 ttypes .TGetOperationStatusResp (
@@ -1694,9 +1673,7 @@ def test_handle_execute_response_sets_active_op_handle(self):
16941673 thrift_backend = self ._make_fake_thrift_backend ()
16951674 thrift_backend ._check_direct_results_for_error = Mock ()
16961675 thrift_backend ._wait_until_command_done = Mock ()
1697- thrift_backend ._results_message_to_execute_response = Mock (
1698- return_value = (Mock (), Mock ())
1699- )
1676+ thrift_backend ._results_message_to_execute_response = Mock ()
17001677
17011678 # Create a mock response with a real operation handle
17021679 mock_resp = Mock ()
@@ -2256,8 +2233,7 @@ def test_protocol_v3_fails_if_initial_namespace_set(self, tcli_client_class):
22562233 @patch ("databricks.sql.backend.thrift_backend.ThriftResultSet" )
22572234 @patch ("databricks.sql.backend.thrift_backend.TCLIService.Client" , autospec = True )
22582235 @patch (
2259- "databricks.sql.backend.thrift_backend.ThriftDatabricksClient._handle_execute_response" ,
2260- return_value = (Mock (), Mock ()),
2236+ "databricks.sql.backend.thrift_backend.ThriftDatabricksClient._handle_execute_response"
22612237 )
22622238 def test_execute_command_sets_complex_type_fields_correctly (
22632239 self , mock_handle_execute_response , tcli_service_class , mock_result_set
0 commit comments