File tree Expand file tree Collapse file tree 1 file changed +14
-0
lines changed
Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -135,3 +135,17 @@ def test_table_from_batches_stream(ctx, fail_collect):
135135
136136 for batch in df :
137137 assert isinstance (batch , pa .RecordBatch )
138+ import pyarrow as pa
139+
140+
141+ def test_table_from_batches_stream ():
142+ schema = pa .schema ([pa .field ("value" , pa .int64 (), nullable = False )])
143+ batch = pa .RecordBatch .from_arrays ([pa .array (range (10 ))], schema = schema )
144+ reader = pa .RecordBatchReader .from_batches (schema , [batch ])
145+ result = pa .Table .from_batches (reader )
146+
147+ expected_schema = pa .schema ([pa .field ("value" , pa .int64 (), nullable = False )])
148+ expected = pa .Table .from_arrays ([pa .array (range (10 ))], schema = expected_schema )
149+
150+ assert result == expected
151+ assert result .schema == expected_schema
You can’t perform that action at this time.
0 commit comments