@@ -403,7 +403,7 @@ def __init__(
403403 self .open = True
404404 self .executing_command_id = None
405405 self .backend = backend
406- self .active_op_handle = None
406+ self .active_command_id = None
407407 self .escaper = ParamEscaper ()
408408 self .lastrowid = None
409409
@@ -862,7 +862,7 @@ def get_query_state(self) -> "TOperationState":
862862 :return:
863863 """
864864 self ._check_not_closed ()
865- return self .backend .get_query_state (self .active_op_handle )
865+ return self .backend .get_query_state (self .active_command_id )
866866
867867 def is_query_pending (self ):
868868 """
@@ -893,7 +893,7 @@ def get_async_execution_result(self):
893893 operation_state = self .get_query_state ()
894894 if operation_state == ttypes .TOperationState .FINISHED_STATE :
895895 execute_response = self .backend .get_execution_result (
896- self .active_op_handle , self
896+ self .active_command_id , self
897897 )
898898 self .active_result_set = ResultSet (
899899 self .connection ,
@@ -1124,8 +1124,8 @@ def cancel(self) -> None:
11241124 The command should be closed to free resources from the server.
11251125 This method can be called from another thread.
11261126 """
1127- if self .active_op_handle is not None :
1128- self .backend .cancel_command (self .active_op_handle )
1127+ if self .active_command_id is not None :
1128+ self .backend .cancel_command (self .active_command_id )
11291129 else :
11301130 logger .warning (
11311131 "Attempting to cancel a command, but there is no "
@@ -1137,9 +1137,9 @@ def close(self) -> None:
11371137 self .open = False
11381138
11391139 # Close active operation handle if it exists
1140- if self .active_op_handle :
1140+ if self .active_command_id :
11411141 try :
1142- self .backend .close_command (self .active_op_handle )
1142+ self .backend .close_command (self .active_command_id )
11431143 except RequestError as e :
11441144 if isinstance (e .args [1 ], CursorAlreadyClosedError ):
11451145 logger .info ("Operation was canceled by a prior request" )
@@ -1148,7 +1148,7 @@ def close(self) -> None:
11481148 except Exception as e :
11491149 logging .warning (f"Error closing operation handle: { e } " )
11501150 finally :
1151- self .active_op_handle = None
1151+ self .active_command_id = None
11521152
11531153 if self .active_result_set :
11541154 self ._close_and_clear_active_result_set ()
@@ -1161,8 +1161,8 @@ def query_id(self) -> Optional[str]:
11611161 This attribute will be ``None`` if the cursor has not had an operation
11621162 invoked via the execute method yet, or if cursor was closed.
11631163 """
1164- if self .active_op_handle is not None :
1165- return self .active_op_handle .to_hex_id ()
1164+ if self .active_command_id is not None :
1165+ return self .active_command_id .to_hex_id ()
11661166 return None
11671167
11681168 @property
0 commit comments