()
| 919 | |
| 920 | |
| 921 | def test_table_from_struct_array(): |
| 922 | struct_array = pa.array( |
| 923 | [{"ints": 1}, {"floats": 1.0}], |
| 924 | type=pa.struct([("ints", pa.int32()), ("floats", pa.float32())]), |
| 925 | ) |
| 926 | result = pa.Table.from_struct_array(struct_array) |
| 927 | assert result.equals(pa.Table.from_arrays( |
| 928 | [ |
| 929 | pa.array([1, None], type=pa.int32()), |
| 930 | pa.array([None, 1.0], type=pa.float32()), |
| 931 | ], ["ints", "floats"] |
| 932 | )) |
| 933 | |
| 934 | |
| 935 | def test_table_from_struct_array_chunked_array(): |