| 4696 | |
| 4697 | |
| 4698 | def test_dunders_checked_overflow(): |
| 4699 | # GH-32007 |
| 4700 | arr = pa.array([127, -128], type=pa.int8()) |
| 4701 | error_match = "overflow" |
| 4702 | |
| 4703 | with pytest.raises(pa.ArrowInvalid, match=error_match): |
| 4704 | arr + arr |
| 4705 | with pytest.raises(pa.ArrowInvalid, match=error_match): |
| 4706 | arr * arr |
| 4707 | with pytest.raises(pa.ArrowInvalid, match=error_match): |
| 4708 | arr - (-arr) |
| 4709 | with pytest.raises(pa.ArrowInvalid, match=error_match): |
| 4710 | arr ** pa.scalar(2, type=pa.int8()) |
| 4711 | with pytest.raises(pa.ArrowInvalid, match=error_match): |
| 4712 | arr / (-arr) |
| 4713 | |
| 4714 | |
| 4715 | @pytest.mark.parametrize("index_type", [pa.int8(), pa.int16(), pa.int32(), pa.int64(), |