[ 
https://issues.apache.org/jira/browse/ARROW-2387?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16436350#comment-16436350
 ] 

ASF GitHub Bot commented on ARROW-2387:
---------------------------------------

bwo commented on issue #1832: ARROW-2387: [Python] Flip test for rescale loss 
if value < 0
URL: https://github.com/apache/arrow/pull/1832#issuecomment-380954273
 
 
   Seems to be failing on something Ruby-related? Should I rebase again?

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


> negative decimal values get spurious rescaling error
> ----------------------------------------------------
>
>                 Key: ARROW-2387
>                 URL: https://issues.apache.org/jira/browse/ARROW-2387
>             Project: Apache Arrow
>          Issue Type: Bug
>    Affects Versions: 0.9.0
>            Reporter: ben w
>            Assignee: Phillip Cloud
>            Priority: Major
>              Labels: pull-request-available
>
> {code:java}
> $ python
> Python 2.7.12 (default, Nov 20 2017, 18:23:56)
> [GCC 5.4.0 20160609] on linux2
> Type "help", "copyright", "credits" or "license" for more information.
> >>> import pyarrow as pa, decimal
> >>> one = decimal.Decimal('1.000000')
> >>> neg_one = decimal.Decimal('-1.000000')
> >>> pa.array([one], pa.decimal128(24, 12))
> <pyarrow.lib.Decimal128Array object at 0x7f7f5ae85cb0>
> [
> Decimal('1.000000000000')
> ]
> >>> pa.array([neg_one], pa.decimal128(24, 12))
> Traceback (most recent call last):
> File "<stdin>", line 1, in <module>
> File "array.pxi", line 181, in pyarrow.lib.array
> File "array.pxi", line 36, in pyarrow.lib._sequence_to_array
> File "error.pxi", line 77, in pyarrow.lib.check_status
> pyarrow.lib.ArrowInvalid: Rescaling decimal value -1000000.000000 from 
> original scale of 6 to new scale of 12 would cause data loss
> >>> pa.__version__
> '0.9.0'
> {code}
> not only is the error spurious, the decimal value has been multiplied by one 
> million (i.e. 10 ** 6 and 6 is the difference in scales, but this is still 
> pretty strange to me).



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

Reply via email to