Skip to content

Commit a9b6ac1

Browse files
committed
fix: update table creation from batches to use to_pyarrow conversion
1 parent 71a9966 commit a9b6ac1

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

python/tests/test_dataframe.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1636,7 +1636,7 @@ def test_arrow_c_stream_to_table_and_reader(fail_collect):
16361636
batch2 = pa.record_batch([pa.array([2])], names=["a"])
16371637
df = ctx.create_dataframe([[batch1], [batch2]])
16381638

1639-
table = pa.Table.from_batches(df)
1639+
table = pa.Table.from_batches(batch.to_pyarrow() for batch in df)
16401640
batches = table.to_batches()
16411641

16421642
assert len(batches) == 2
@@ -1660,7 +1660,7 @@ def test_arrow_c_stream_order():
16601660

16611661
df = ctx.create_dataframe([[batch1, batch2]])
16621662

1663-
table = pa.Table.from_batches(df)
1663+
table = pa.Table.from_batches(batch.to_pyarrow() for batch in df)
16641664
expected = pa.Table.from_batches([batch1, batch2])
16651665

16661666
assert table.equals(expected)

python/tests/test_io.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,6 @@ def test_arrow_c_stream_large_dataset(ctx):
128128
def test_table_from_batches_stream(ctx, fail_collect):
129129
df = range_table(ctx, 0, 10)
130130

131-
table = pa.Table.from_batches(df)
131+
table = pa.Table.from_batches(batch.to_pyarrow() for batch in df)
132132
assert table.shape == (10, 1)
133133
assert table.column_names == ["value"]

0 commit comments

Comments
 (0)