()
| 1774 | |
| 1775 | |
| 1776 | def test_inverse_permutation(): |
| 1777 | arr0 = pa.array([], type=pa.int32()) |
| 1778 | arr = pa.chunked_array([ |
| 1779 | arr0, [9, 7, 5, 3, 1], [0], [2, 4, 6], [8], arr0, |
| 1780 | ]) |
| 1781 | expected = pa.chunked_array([[5, 4, 6, 3, 7, 2, 8, 1, 9, 0]], type=pa.int32()) |
| 1782 | assert pc.inverse_permutation(arr).equals(expected) |
| 1783 | |
| 1784 | options = pc.InversePermutationOptions(max_index=9, output_type=pa.int32()) |
| 1785 | assert pc.inverse_permutation(arr, options=options).equals(expected) |
| 1786 | assert pc.inverse_permutation(arr, max_index=-1).equals(expected) |
| 1787 | |
| 1788 | with pytest.raises(ArrowIndexError, match="Index out of bounds: 9"): |
| 1789 | pc.inverse_permutation(arr, max_index=4) |
| 1790 | |
| 1791 | |
| 1792 | def test_scatter(): |
nothing calls this directly
no test coverage detected