You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jira@arrow.apache.org by "Antoine Pitrou (Jira)" <ji...@apache.org> on 2021/09/01 14:41:00 UTC

[jira] [Resolved] (ARROW-12011) [C++][Python] Crashes and incorrect results when converting large integers to dates

     [ https://issues.apache.org/jira/browse/ARROW-12011?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Antoine Pitrou resolved ARROW-12011.
------------------------------------
    Resolution: Fixed

Issue resolved by pull request 10988
[https://github.com/apache/arrow/pull/10988]

> [C++][Python] Crashes and incorrect results when converting large integers to dates
> -----------------------------------------------------------------------------------
>
>                 Key: ARROW-12011
>                 URL: https://issues.apache.org/jira/browse/ARROW-12011
>             Project: Apache Arrow
>          Issue Type: Bug
>          Components: C++, Python
>    Affects Versions: 3.0.0
>         Environment: OS: Windows 10 Pro (Version 20H2)
> CPU: AMD Ryzen 5 1600 Six-Core Processor 3.20 GHz
> Python: 3.8.8 AMD64
> pyarrow is latest version installed with pip
>            Reporter: Tim Evans
>            Assignee: Antoine Pitrou
>            Priority: Major
>              Labels: pull-request-available
>             Fix For: 5.0.1, 6.0.0
>
>          Time Spent: 3h 10m
>  Remaining Estimate: 0h
>
> Running this code snippet will cause a crash. This happens for a range of numbers around this one as well:
>  
> {code:java}
> import pyarrow
> date = pyarrow.array([-1448879500], pyarrow.date32())
> print(date)
> {code}
> I don't know where this crash is coming from, so it might be in the C++ code rather than the Python bindings.
> For other extreme numbers you get the wrong result. It looks like something is overflowing. Here is the input and result for a few different examples:
>  * -2000000000 -> 31179-12-27
>  * -1000000000 -> 16574-12-29
>  * 2000000000 -> -27240-01-06
>  * 1000000000 -> -12635-01-03
> I would prefer if these gave errors rather than silently overflowing.
>  



--
This message was sent by Atlassian Jira
(v8.3.4#803005)