pitrou commented on a change in pull request #9948:
URL: https://github.com/apache/arrow/pull/9948#discussion_r609651237
##########
File path: python/pyarrow/tests/test_convert_builtin.py
##########
@@ -1501,6 +1501,23 @@ def test_sequence_decimal_too_high_precision():
pa.array([decimal.Decimal('1' * 80)])
+def test_sequence_decimal_infer():
+ # ARROW-12150 - ensure mixed precision gets correctly inferred to
+ # common type that can hold all input values
+ cases = [
+ ([decimal.Decimal('1.234'), decimal.Decimal('3.456')],
+ pa.decimal128(4, 3)),
+ ([decimal.Decimal('1.234'), decimal.Decimal('456.7')],
+ pa.decimal128(6, 3)),
+ ([decimal.Decimal('123.4'), decimal.Decimal('4.567')],
+ pa.decimal128(6, 3)),
+ ]
Review comment:
What about e.g. `[Decimal('123e2'), Decimal('4567e3')]`?
--
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.
For queries about this service, please contact Infrastructure at:
[email protected]