MCPcopy Create free account
hub / github.com/apache/arrow / test_recordbatch_from_struct_array

Function test_recordbatch_from_struct_array

python/pyarrow/tests/test_table.py:883–894  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

881
882
883def 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
897def test_recordbatch_to_struct_array():

Callers

nothing calls this directly

Calls 2

equalsMethod · 0.80
arrayMethod · 0.45

Tested by

no test coverage detected