| 1619 | |
| 1620 | |
| 1621 | def 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 | |
| 1642 | def test_table_column_with_duplicates(): |