[ https://issues.apache.org/jira/browse/ARROW-4457?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Rok Mihevc updated ARROW-4457: ------------------------------ External issue URL: https://github.com/apache/arrow/issues/21014 > [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 > Components: Python > Affects Versions: 0.11.0, 0.11.1, 0.12.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 > Assignee: Antoine Pitrou > Priority: Major > Labels: pull-request-available > Fix For: 0.13.0 > > Time Spent: 40m > Remaining Estimate: 0h > > 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 (v8.20.10#820010)