File tree Expand file tree Collapse file tree 4 files changed +17
-6
lines changed Expand file tree Collapse file tree 4 files changed +17
-6
lines changed Original file line number Diff line number Diff line change @@ -42,7 +42,7 @@ def execute_command(
42
42
parameters : List [ttypes .TSparkParameter ],
43
43
async_op : bool ,
44
44
enforce_embedded_schema_correctness : bool ,
45
- ) -> "ResultSet" :
45
+ ) -> Union [ "ResultSet" , None ] :
46
46
pass
47
47
48
48
@abstractmethod
@@ -62,7 +62,7 @@ def get_execution_result(
62
62
self ,
63
63
command_id : CommandId ,
64
64
cursor : Any ,
65
- ) -> ExecuteResponse :
65
+ ) -> "ResultSet" :
66
66
pass
67
67
68
68
# == Metadata Operations ==
Original file line number Diff line number Diff line change @@ -944,7 +944,7 @@ def execute_command(
944
944
parameters = [],
945
945
async_op = False ,
946
946
enforce_embedded_schema_correctness = False ,
947
- ) -> "ResultSet" :
947
+ ) -> Union [ "ResultSet" , None ] :
948
948
thrift_handle = session_id .to_thrift_handle ()
949
949
if not thrift_handle :
950
950
raise ValueError ("Not a valid Thrift session ID" )
Original file line number Diff line number Diff line change @@ -783,7 +783,7 @@ def execute(
783
783
enforce_embedded_schema_correctness = enforce_embedded_schema_correctness ,
784
784
)
785
785
786
- if self .active_result_set .is_staging_operation :
786
+ if self .active_result_set and self . active_result_set .is_staging_operation :
787
787
self ._handle_staging_operation (
788
788
staging_allowed_local_path = self .backend .staging_allowed_local_path
789
789
)
@@ -879,7 +879,7 @@ def get_async_execution_result(self):
879
879
self .active_op_handle , self
880
880
)
881
881
882
- if self .active_result_set .is_staging_operation :
882
+ if self .active_result_set and self . active_result_set .is_staging_operation :
883
883
self ._handle_staging_operation (
884
884
staging_allowed_local_path = self .backend .staging_allowed_local_path
885
885
)
Original file line number Diff line number Diff line change @@ -46,6 +46,12 @@ def __iter__(self):
46
46
def rownumber (self ):
47
47
return self ._next_row_index
48
48
49
+ @property
50
+ @abstractmethod
51
+ def is_staging_operation (self ) -> bool :
52
+ """Whether this result set represents a staging operation."""
53
+ pass
54
+
49
55
# Define abstract methods that concrete implementations must implement
50
56
@abstractmethod
51
57
def _fill_results_buffer (self ):
@@ -117,7 +123,7 @@ def __init__(
117
123
self .description = execute_response .description
118
124
self ._arrow_schema_bytes = execute_response .arrow_schema_bytes
119
125
self ._use_cloud_fetch = use_cloud_fetch
120
- self .is_staging_operation = execute_response .is_staging_operation
126
+ self ._is_staging_operation = execute_response .is_staging_operation
121
127
122
128
# Initialize results queue
123
129
if execute_response .arrow_queue :
@@ -350,3 +356,8 @@ def close(self) -> None:
350
356
finally :
351
357
self .has_been_closed_server_side = True
352
358
self .op_state = ttypes .TOperationState .CLOSED_STATE
359
+
360
+ @property
361
+ def is_staging_operation (self ) -> bool :
362
+ """Whether this result set represents a staging operation."""
363
+ return self ._is_staging_operation
You can’t perform that action at this time.
0 commit comments