You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@arrow.apache.org by "Diego Argueta (JIRA)" <ji...@apache.org> on 2019/02/01 22:31:00 UTC

[jira] [Created] (ARROW-4457) [Python] Cannot create Decimal128 array using integers

Diego Argueta created ARROW-4457:
------------------------------------

             Summary: [Python] Cannot create Decimal128 array using integers
                 Key: ARROW-4457
                 URL: https://issues.apache.org/jira/browse/ARROW-4457
             Project: Apache Arrow
          Issue Type: Bug
    Affects Versions: 0.12.0, 0.11.1, 0.11.0
         Environment: Python: 2.7.15 and 3.7.2
pyarrow: tested on 0.11.0, 0.11.1, 0.12.0
            Reporter: Diego Argueta


There appears to have been a regression introduced in 0.11.0 such that we can no longer create a {{Decimal128}} array using integers.

To reproduce:
{code:python}
import pyarrow
column = pyarrow.decimal128(16, 4)
array = pyarrow.array([1], column)
{code}

Expected result: Behavior same as 0.10.0 and earlier; a {{Decimal128}} array would be created with no problems.

Actual result: an exception is thrown.

{code}
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "pyarrow/array.pxi", line 175, in pyarrow.lib.array
    return _sequence_to_array(obj, mask, size, type, pool, from_pandas)
  File "pyarrow/array.pxi", line 36, in pyarrow.lib._sequence_to_array
    check_status(ConvertPySequence(sequence, mask, options, &out))
  File "pyarrow/error.pxi", line 81, in pyarrow.lib.check_status
    raise ArrowInvalid(message)
ArrowInvalid: Could not convert 1 with type int: converting to Decimal128
Could not convert 1 with type int: converting to Decimal128
{code}

The crash doesn't occur if we use a {{decimal.Decimal}} object instead.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)