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

Function test_table_from_struct_array

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

Source from the content-addressed store, hash-verified

919
920
921def 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
935def test_table_from_struct_array_chunked_array():

Callers

nothing calls this directly

Calls 2

equalsMethod · 0.80
arrayMethod · 0.45

Tested by

no test coverage detected