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

Function test_concat_tables

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

Source from the content-addressed store, hash-verified

2033
2034
2035def test_concat_tables():
2036 data = [
2037 list(range(5)),
2038 [-10., -5., 0., 5., 10.]
2039 ]
2040 data2 = [
2041 list(range(5, 10)),
2042 [1., 2., 3., 4., 5.]
2043 ]
2044
2045 t1 = pa.Table.from_arrays([pa.array(x) for x in data],
2046 names=('a', 'b'))
2047 t2 = pa.Table.from_arrays([pa.array(x) for x in data2],
2048 names=('a', 'b'))
2049
2050 result = pa.concat_tables([t1, t2])
2051 result.validate()
2052 assert len(result) == 10
2053
2054 expected = pa.Table.from_arrays([pa.array(x + y)
2055 for x, y in zip(data, data2)],
2056 names=('a', 'b'))
2057
2058 assert result.equals(expected)
2059
2060
2061def test_concat_tables_permissive():

Callers

nothing calls this directly

Calls 5

listFunction · 0.85
lenFunction · 0.85
equalsMethod · 0.80
arrayMethod · 0.45
validateMethod · 0.45

Tested by

no test coverage detected