Skip to content

Commit 5075fde

Browse files
committed
Add test_table_from_struct_array_chunked_array
1 parent c2bbf7d commit 5075fde

1 file changed

Lines changed: 14 additions & 0 deletions

File tree

python/pyarrow/tests/test_table.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -915,6 +915,20 @@ def test_table_from_struct_array():
915915
))
916916

917917

918+
def test_table_from_struct_array_chunked_array():
919+
chunked_struct_array = pa.chunked_array(
920+
[{"ints": 1}, {"floats": 1.0}],
921+
type=pa.struct([("ints", pa.int32()), ("floats", pa.float32())]),
922+
)
923+
result = pa.Table.from_struct_array(chunked_struct_array)
924+
assert result.equals(pa.Table.from_arrays(
925+
[
926+
pa.array([1, None], type=pa.int32()),
927+
pa.array([None, 1.0], type=pa.float32()),
928+
], ["ints", "floats"]
929+
))
930+
931+
918932
def test_table_to_struct_array():
919933
table = pa.Table.from_arrays(
920934
[

0 commit comments

Comments
 (0)