()
| 881 | |
| 882 | |
| 883 | def test_recordbatch_from_struct_array(): |
| 884 | struct_array = pa.array( |
| 885 | [{"ints": 1}, {"floats": 1.0}], |
| 886 | type=pa.struct([("ints", pa.int32()), ("floats", pa.float32())]), |
| 887 | ) |
| 888 | result = pa.RecordBatch.from_struct_array(struct_array) |
| 889 | assert result.equals(pa.RecordBatch.from_arrays( |
| 890 | [ |
| 891 | pa.array([1, None], type=pa.int32()), |
| 892 | pa.array([None, 1.0], type=pa.float32()), |
| 893 | ], ["ints", "floats"] |
| 894 | )) |
| 895 | |
| 896 | |
| 897 | def test_recordbatch_to_struct_array(): |