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

Function test_table_from_lists

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

Source from the content-addressed store, hash-verified

1564
1565
1566def test_table_from_lists():
1567 data = [
1568 list(range(5)),
1569 [-10, -5, 0, 5, 10]
1570 ]
1571
1572 result = pa.table(data, names=['a', 'b'])
1573 expected = pa.Table.from_arrays(data, names=['a', 'b'])
1574 assert result.equals(expected)
1575
1576 schema = pa.schema([
1577 pa.field('a', pa.uint16()),
1578 pa.field('b', pa.int64())
1579 ])
1580 result = pa.table(data, schema=schema)
1581 expected = pa.Table.from_arrays(data, schema=schema)
1582 assert result.equals(expected)
1583
1584
1585def test_table_pickle(pickle_module):

Callers

nothing calls this directly

Calls 4

listFunction · 0.85
equalsMethod · 0.80
schemaMethod · 0.45
fieldMethod · 0.45

Tested by

no test coverage detected