File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -1610,6 +1610,23 @@ def test_arrow_c_stream_to_table(fail_collect):
16101610 assert table .column ("a" ).num_chunks == 2
16111611
16121612
1613+ def test_arrow_c_stream_order ():
1614+ ctx = SessionContext ()
1615+
1616+ batch1 = pa .record_batch ([pa .array ([1 ])], names = ["a" ])
1617+ batch2 = pa .record_batch ([pa .array ([2 ])], names = ["a" ])
1618+
1619+ df = ctx .create_dataframe ([[batch1 , batch2 ]])
1620+
1621+ table = pa .Table .from_batches (df )
1622+ expected = pa .Table .from_batches ([batch1 , batch2 ])
1623+
1624+ assert table .equals (expected )
1625+ col = table .column ("a" )
1626+ assert col .chunk (0 )[0 ].as_py () == 1
1627+ assert col .chunk (1 )[0 ].as_py () == 2
1628+
1629+
16131630def test_arrow_c_stream_reader (df ):
16141631 reader = pa .RecordBatchReader ._import_from_c_capsule (df .__arrow_c_stream__ ())
16151632 assert isinstance (reader , pa .RecordBatchReader )
You can’t perform that action at this time.
0 commit comments