File tree 1 file changed +5
-10
lines changed 1 file changed +5
-10
lines changed Original file line number Diff line number Diff line change @@ -131,14 +131,9 @@ def __to_pandas_kernel(self):
131
131
return pd .DataFrame (columns = schema .names )
132
132
133
133
batches = scan .execute (interface )
134
- pdfs = [batch .to_pandas () for batch in batches ]
135
-
136
- result = pd .concat (
137
- pdfs ,
138
- axis = 0 ,
139
- ignore_index = True ,
140
- copy = False ,
141
- )
134
+ pdfs = [batch .to_pandas (self_destruct = True ) for batch in batches ]
135
+
136
+ result = pd .concat (pdfs , axis = 0 , ignore_index = True , copy = False )
142
137
143
138
# Apply residual limit that was not handled from server pushdown
144
139
result = result .head (self ._limit )
@@ -372,8 +367,8 @@ def __table_changes_to_pandas_kernel(self, cdfOptions: CdfOptions) -> pd.DataFra
372
367
schema = scan .execute (interface ).schema
373
368
result = pd .DataFrame (columns = schema .names )
374
369
else :
375
- table = pa . Table . from_batches ( scan .execute (interface ))
376
- result = table . to_pandas ( )
370
+ pdfs = [ batch . to_pandas ( self_destruct = True ) for batch in scan .execute (interface )]
371
+ result = pd . concat ( pdfs , axis = 0 , ignore_index = True , copy = False )
377
372
finally :
378
373
# Delete the temp folder explicitly and remove the delta format from header
379
374
temp_dir .cleanup ()
You can’t perform that action at this time.
0 commit comments