You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@arrow.apache.org by "Wes McKinney (JIRA)" <ji...@apache.org> on 2019/02/08 15:42:00 UTC
[jira] [Commented] (ARROW-4457) [Python] Cannot create Decimal128
array using integers
[ https://issues.apache.org/jira/browse/ARROW-4457?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16763707#comment-16763707 ]
Wes McKinney commented on ARROW-4457:
-------------------------------------
[~kszucs] do you know what might have happened here?
> [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.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
> Priority: Major
> Fix For: 0.13.0
>
>
> 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)