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

Function test_table_select_column

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

Source from the content-addressed store, hash-verified

1680
1681
1682def test_table_select_column():
1683 data = [
1684 pa.array(range(5)),
1685 pa.array([-10, -5, 0, 5, 10]),
1686 pa.array(range(5, 10))
1687 ]
1688 table = pa.Table.from_arrays(data, names=('a', 'b', 'c'))
1689
1690 assert table.column('a').equals(table.column(0))
1691
1692 with pytest.raises(KeyError,
1693 match='Field "d" does not exist in schema'):
1694 table.column('d')
1695
1696 with pytest.raises(TypeError):
1697 table.column(None)
1698
1699 with pytest.raises(IndexError):
1700 table.column(4)
1701
1702
1703def 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