| 2161 | |
| 2162 | |
| 2163 | def test_table_negative_indexing(): |
| 2164 | data = [ |
| 2165 | pa.array(range(5)), |
| 2166 | pa.array([-10, -5, 0, 5, 10]), |
| 2167 | pa.array([1.0, 2.0, 3.0, 4.0, 5.0]), |
| 2168 | pa.array(['ab', 'bc', 'cd', 'de', 'ef']), |
| 2169 | ] |
| 2170 | table = pa.Table.from_arrays(data, names=tuple('abcd')) |
| 2171 | |
| 2172 | assert table[-1].equals(table[3]) |
| 2173 | assert table[-2].equals(table[2]) |
| 2174 | assert table[-3].equals(table[1]) |
| 2175 | assert table[-4].equals(table[0]) |
| 2176 | |
| 2177 | with pytest.raises(IndexError): |
| 2178 | table[-5] |
| 2179 | |
| 2180 | with pytest.raises(IndexError): |
| 2181 | table[4] |
| 2182 | |
| 2183 | |
| 2184 | def test_concat_batches(): |