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

Function test_table_select_column

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

Source from the content-addressed store, hash-verified

1619
1620
1621def test_table_select_column():
1622 data = [
1623 pa.array(range(5)),
1624 pa.array([-10, -5, 0, 5, 10]),
1625 pa.array(range(5, 10))
1626 ]
1627 table = pa.Table.from_arrays(data, names=('a', 'b', 'c'))
1628
1629 assert table.column('a').equals(table.column(0))
1630
1631 with pytest.raises(KeyError,
1632 match='Field "d" does not exist in schema'):
1633 table.column('d')
1634
1635 with pytest.raises(TypeError):
1636 table.column(None)
1637
1638 with pytest.raises(IndexError):
1639 table.column(4)
1640
1641
1642def test_table_column_with_duplicates():

Callers

nothing calls this directly

Calls 3

equalsMethod · 0.80
arrayMethod · 0.45
columnMethod · 0.45

Tested by

no test coverage detected