()
| 3047 | |
| 3048 | |
| 3049 | def test_index(): |
| 3050 | arr = pa.array([0, 1, None, 3, 4], type=pa.int64()) |
| 3051 | assert pc.index(arr, pa.scalar(0)).as_py() == 0 |
| 3052 | assert pc.index(arr, pa.scalar(2, type=pa.int8())).as_py() == -1 |
| 3053 | assert pc.index(arr, 4).as_py() == 4 |
| 3054 | assert arr.index(3, start=2).as_py() == 3 |
| 3055 | assert arr.index(None).as_py() == -1 |
| 3056 | |
| 3057 | arr = pa.chunked_array([[1, 2], [1, 3]], type=pa.int64()) |
| 3058 | assert arr.index(1).as_py() == 0 |
| 3059 | assert arr.index(1, start=2).as_py() == 2 |
| 3060 | assert arr.index(1, start=1, end=2).as_py() == -1 |
| 3061 | |
| 3062 | |
| 3063 | def check_partition_nth(data, indices, pivot, null_placement): |
nothing calls this directly
no test coverage detected