| 1749 | ] |
| 1750 | ) |
| 1751 | def test_table_set_column(cls): |
| 1752 | data = [ |
| 1753 | pa.array(range(5)), |
| 1754 | pa.array([-10, -5, 0, 5, 10]), |
| 1755 | pa.array(range(5, 10)) |
| 1756 | ] |
| 1757 | table = cls.from_arrays(data, names=('a', 'b', 'c')) |
| 1758 | |
| 1759 | new_field = pa.field('d', data[1].type) |
| 1760 | t2 = table.set_column(0, new_field, data[1]) |
| 1761 | |
| 1762 | expected_data = list(data) |
| 1763 | expected_data[0] = data[1] |
| 1764 | expected = cls.from_arrays(expected_data, |
| 1765 | names=('d', 'b', 'c')) |
| 1766 | assert t2.equals(expected) |
| 1767 | |
| 1768 | |
| 1769 | @pytest.mark.parametrize( |