|
86 | 86 |
|
87 | 87 |
|
88 | 88 | class ThriftDatabricksClient(DatabricksClient): |
89 | | - CLOSED_OP_STATE = ttypes.TOperationState.CLOSED_STATE |
90 | | - ERROR_OP_STATE = ttypes.TOperationState.ERROR_STATE |
| 89 | + CLOSED_OP_STATE = CommandState.CLOSED |
| 90 | + ERROR_OP_STATE = CommandState.FAILED |
91 | 91 |
|
92 | 92 | _retry_delay_min: float |
93 | 93 | _retry_delay_max: float |
@@ -351,6 +351,7 @@ def make_request(self, method, request, retryable=True): |
351 | 351 | Will stop retry attempts if total elapsed time + next retry delay would exceed |
352 | 352 | _retry_stop_after_attempts_duration. |
353 | 353 | """ |
| 354 | + |
354 | 355 | # basic strategy: build range iterator rep'ing number of available |
355 | 356 | # retries. bounds can be computed from there. iterate over it with |
356 | 357 | # retries until success or final failure achieved. |
@@ -798,7 +799,7 @@ def _results_message_to_execute_response(self, resp, operation_state): |
798 | 799 |
|
799 | 800 | return ExecuteResponse( |
800 | 801 | arrow_queue=arrow_queue_opt, |
801 | | - status=operation_state, |
| 802 | + status=CommandState.from_thrift_state(operation_state), |
802 | 803 | has_been_closed_server_side=has_been_closed_server_side, |
803 | 804 | has_more_rows=has_more_rows, |
804 | 805 | lz4_compressed=lz4_compressed, |
@@ -863,7 +864,7 @@ def get_execution_result( |
863 | 864 |
|
864 | 865 | execute_response = ExecuteResponse( |
865 | 866 | arrow_queue=queue, |
866 | | - status=resp.status, |
| 867 | + status=CommandState.from_thrift_state(resp.status), |
867 | 868 | has_been_closed_server_side=False, |
868 | 869 | has_more_rows=has_more_rows, |
869 | 870 | lz4_compressed=lz4_compressed, |
|
0 commit comments