pc.subtract_checked(x, x) with x as pa.array((1, 2, 3, 4, 5), type=pa.decimal128(38, 19)) raises "Decimal precision out of range"
Open
Component: Python
Type: bug
- Dominant language
- C++
- Stars
- 17.1k
- Forks
- 4.3k
- Avg merge
- 3d 13h
- Merged PRs (30d)
- 88
Description
### Describe the bug, including details regarding any error messages, version, and platform.
### Code
```python
import pyarrow as pa
import pyarrow.compute as pc
x = pa.array((1, 2, 3, 4, 5), type=pa.decimal128(38, 19))
print(
pc.subtract_checked(x, x)
) # ArrowInvalid: Decimal precision out of range [1, 38]: 39
```
### Component(s)
Python
### Environment
python == 3.13.7
pyarrow == 21.0.0
os == "Ubuntu 24.04.3 LTS"
cpu == "AMD Ryzen™ 5 5600H with Radeon™ Graphics × 12"
Contributor guide
Assessment
This issue has not been assessed yet.