Skip to content

Commit 7951ea5

Browse files
committed
Reapply "Add test for iterating over batches in DataFrame"
This reverts commit d997c70.
1 parent d997c70 commit 7951ea5

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

python/tests/test_dataframe.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1582,6 +1582,18 @@ def test_empty_to_arrow_table(df):
15821582
assert set(pyarrow_table.column_names) == {"a", "b", "c"}
15831583

15841584

1585+
def test_iter_batches_dataframe(fail_collect):
1586+
ctx = SessionContext()
1587+
1588+
batch1 = pa.record_batch([pa.array([1])], names=["a"])
1589+
batch2 = pa.record_batch([pa.array([2])], names=["a"])
1590+
df = ctx.create_dataframe([[batch1], [batch2]])
1591+
1592+
expected = [batch1, batch2]
1593+
for got, exp in zip(df, expected):
1594+
assert got.equals(exp)
1595+
1596+
15851597
def test_arrow_c_stream_to_table(fail_collect):
15861598
ctx = SessionContext()
15871599

0 commit comments

Comments
 (0)