deanm0000 commented on code in PR #44409:
URL: https://github.com/apache/arrow/pull/44409#discussion_r1806664416
##########
python/pyarrow/tests/test_compute.py:
##########
@@ -376,6 +386,57 @@ def test_sum_chunked_array(arrow_type):
assert pc.sum(arr, min_count=0).as_py() == 0
[email protected]('arrow_type', decimal_arrow_types)
+def test_sum_decimal_array(arrow_type):
Review Comment:
It'd probably be good to add a test with auto inferred decimal precisions
from mixed inputs. Something like
```python
a=pa.array([Decimal("1.232345"), Decimal("1.25"), Decimal("-100.25")])
assert a.type==pa.decimal128(9,6)
assert a.sum().as_py()==Decimal('-97.767655')
```
polars has an issue which pyarrow doesn't where multiplying decimals causes
the precision to double so this test too
```python
b=pa.array([1,2,3])
c=pc.multiple(a,b)
assert c.type==pa.decimal128(9,6)
```
It looks like when we divide it adds 20 decimal places so I'm not sure if
that's intended
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]