| 1680 | |
| 1681 | |
| 1682 | def 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 | |
| 1703 | def test_table_column_with_duplicates(): |