()
| 895 | |
| 896 | |
| 897 | def test_recordbatch_to_struct_array(): |
| 898 | batch = pa.RecordBatch.from_arrays( |
| 899 | [ |
| 900 | pa.array([1, None], type=pa.int32()), |
| 901 | pa.array([None, 1.0], type=pa.float32()), |
| 902 | ], ["ints", "floats"] |
| 903 | ) |
| 904 | result = batch.to_struct_array() |
| 905 | assert result.equals(pa.array( |
| 906 | [{"ints": 1}, {"floats": 1.0}], |
| 907 | type=pa.struct([("ints", pa.int32()), ("floats", pa.float32())]), |
| 908 | )) |
| 909 | |
| 910 | |
| 911 | def test_table_from_struct_array_invalid(): |