@@ -64,7 +64,7 @@ def __init__(
64
64
"""
65
65
66
66
self .connection = connection
67
- self .backend = backend # Store the backend client directly
67
+ self .backend = backend
68
68
self .arraysize = arraysize
69
69
self .buffer_size_bytes = buffer_size_bytes
70
70
self ._next_row_index = 0
@@ -115,12 +115,12 @@ def fetchall(self) -> List[Row]:
115
115
pass
116
116
117
117
@abstractmethod
118
- def fetchmany_arrow (self , size : int ) -> Any :
118
+ def fetchmany_arrow (self , size : int ) -> "pyarrow.Table" :
119
119
"""Fetch the next set of rows as an Arrow table."""
120
120
pass
121
121
122
122
@abstractmethod
123
- def fetchall_arrow (self ) -> Any :
123
+ def fetchall_arrow (self ) -> "pyarrow.Table" :
124
124
"""Fetch all remaining rows as an Arrow table."""
125
125
pass
126
126
@@ -207,7 +207,7 @@ def _fill_results_buffer(self):
207
207
use_cloud_fetch = self ._use_cloud_fetch ,
208
208
)
209
209
self .results = results
210
- self ._has_more_rows = has_more_rows
210
+ self .has_more_rows = has_more_rows
211
211
212
212
def _convert_columnar_table (self , table ):
213
213
column_names = [c [0 ] for c in self .description ]
@@ -259,7 +259,7 @@ def _convert_arrow_table(self, table):
259
259
res = df .to_numpy (na_value = None , dtype = "object" )
260
260
return [ResultRow (* v ) for v in res ]
261
261
262
- def merge_columnar (self , result1 , result2 ):
262
+ def merge_columnar (self , result1 , result2 ) -> "ColumnTable" :
263
263
"""
264
264
Function to merge / combining the columnar results into a single result
265
265
:param result1:
@@ -291,7 +291,7 @@ def fetchmany_arrow(self, size: int) -> "pyarrow.Table":
291
291
while (
292
292
n_remaining_rows > 0
293
293
and not self .has_been_closed_server_side
294
- and self ._has_more_rows
294
+ and self .has_more_rows
295
295
):
296
296
self ._fill_results_buffer ()
297
297
partial_results = self .results .next_n_rows (n_remaining_rows )
@@ -316,7 +316,7 @@ def fetchmany_columnar(self, size: int):
316
316
while (
317
317
n_remaining_rows > 0
318
318
and not self .has_been_closed_server_side
319
- and self ._has_more_rows
319
+ and self .has_more_rows
320
320
):
321
321
self ._fill_results_buffer ()
322
322
partial_results = self .results .next_n_rows (n_remaining_rows )
@@ -331,7 +331,7 @@ def fetchall_arrow(self) -> "pyarrow.Table":
331
331
results = self .results .remaining_rows ()
332
332
self ._next_row_index += results .num_rows
333
333
334
- while not self .has_been_closed_server_side and self ._has_more_rows :
334
+ while not self .has_been_closed_server_side and self .has_more_rows :
335
335
self ._fill_results_buffer ()
336
336
partial_results = self .results .remaining_rows ()
337
337
if isinstance (results , ColumnTable ) and isinstance (
@@ -357,7 +357,7 @@ def fetchall_columnar(self):
357
357
results = self .results .remaining_rows ()
358
358
self ._next_row_index += results .num_rows
359
359
360
- while not self .has_been_closed_server_side and self ._has_more_rows :
360
+ while not self .has_been_closed_server_side and self .has_more_rows :
361
361
self ._fill_results_buffer ()
362
362
partial_results = self .results .remaining_rows ()
363
363
results = self .merge_columnar (results , partial_results )
0 commit comments