Skip to content

Commit d2748d0

Browse files
committed
add args to to_pandas
1 parent 89b6cd4 commit d2748d0

File tree

1 file changed

+5
-10
lines changed

1 file changed

+5
-10
lines changed

python/delta_sharing/reader.py

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -131,14 +131,9 @@ def __to_pandas_kernel(self):
131131
return pd.DataFrame(columns=schema.names)
132132

133133
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)
142137

143138
# Apply residual limit that was not handled from server pushdown
144139
result = result.head(self._limit)
@@ -372,8 +367,8 @@ def __table_changes_to_pandas_kernel(self, cdfOptions: CdfOptions) -> pd.DataFra
372367
schema = scan.execute(interface).schema
373368
result = pd.DataFrame(columns=schema.names)
374369
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)
377372
finally:
378373
# Delete the temp folder explicitly and remove the delta format from header
379374
temp_dir.cleanup()

0 commit comments

Comments
 (0)