verify the alias of drop_columns is working
()
| 1794 | |
| 1795 | |
| 1796 | def test_table_drop(): |
| 1797 | """ verify the alias of drop_columns is working""" |
| 1798 | a = pa.array(range(5)) |
| 1799 | b = pa.array([-10, -5, 0, 5, 10]) |
| 1800 | c = pa.array(range(5, 10)) |
| 1801 | |
| 1802 | table = pa.Table.from_arrays([a, b, c], names=('a', 'b', 'c')) |
| 1803 | t2 = table.drop(['a', 'b']) |
| 1804 | t3 = table.drop('a') |
| 1805 | |
| 1806 | exp_t2 = pa.Table.from_arrays([c], names=('c',)) |
| 1807 | assert exp_t2.equals(t2) |
| 1808 | exp_t3 = pa.Table.from_arrays([b, c], names=('b', 'c',)) |
| 1809 | assert exp_t3.equals(t3) |
| 1810 | |
| 1811 | # -- raise KeyError if column not in Table |
| 1812 | with pytest.raises(KeyError, match="Column 'd' not found"): |
| 1813 | table.drop(['d']) |
| 1814 | |
| 1815 | |
| 1816 | @pytest.mark.parametrize( |