()
| 1790 | |
| 1791 | |
| 1792 | def test_scatter(): |
| 1793 | values = pa.array([True, False, True, True, False, False, True, True, True, False]) |
| 1794 | indices = pa.array([9, 8, 7, 6, 5, 4, 3, 2, 1, 0]) |
| 1795 | expected = pa.array([False, True, True, True, False, |
| 1796 | False, True, True, False, True]) |
| 1797 | result = pc.scatter(values, indices) |
| 1798 | assert result.equals(expected) |
| 1799 | |
| 1800 | options = pc.ScatterOptions(max_index=-1) |
| 1801 | assert pc.scatter(values, indices, options=options).equals(expected) |
| 1802 | assert pc.scatter(values, indices, max_index=9).equals(expected) |
| 1803 | |
| 1804 | with pytest.raises(ArrowIndexError, match="Index out of bounds: 9"): |
| 1805 | pc.scatter(values, indices, max_index=4) |
| 1806 | |
| 1807 | |
| 1808 | @pytest.mark.parametrize("typ", ["array", "chunked_array"]) |
nothing calls this directly
no test coverage detected