You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jira@arrow.apache.org by "Rok Mihevc (Jira)" <ji...@apache.org> on 2023/01/11 07:21:03 UTC

[jira] [Commented] (ARROW-2288) [Python] slicing logic defective

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

Rok Mihevc commented on ARROW-2288:
-----------------------------------

This issue has been migrated to [issue #18243|https://github.com/apache/arrow/issues/18243] on GitHub. Please see the [migration documentation|https://github.com/apache/arrow/issues/14542] for further details.

> [Python] slicing logic defective
> --------------------------------
>
>                 Key: ARROW-2288
>                 URL: https://issues.apache.org/jira/browse/ARROW-2288
>             Project: Apache Arrow
>          Issue Type: Bug
>          Components: Python
>    Affects Versions: 0.8.0
>            Reporter: Antoine Pitrou
>            Assignee: Antoine Pitrou
>            Priority: Major
>              Labels: pull-request-available
>             Fix For: 0.9.0
>
>
> The slicing logic tends to go too far when normalizing large negative bounds, which leads to results not in line with Python's slicing semantics:
> {code}
> >>> arr = pa.array([1,2,3,4])
> >>> arr[-99:100]
> <pyarrow.lib.Int64Array object at 0x7f550813a318>
> [
>   2,
>   3,
>   4
> ]
> >>> arr.to_pylist()[-99:100]
> [1, 2, 3, 4]
> >>> 
> >>> 
> >>> arr[-6:-5]
> <pyarrow.lib.Int64Array object at 0x7f54cd76a908>
> [
>   3
> ]
> >>> arr.to_pylist()[-6:-5]
> []
> {code}
> Also note this crash:
> {code}
> >>> arr[10:13]
> /home/antoine/arrow/cpp/src/arrow/array.cc:105 Check failed: (offset) <= (data.length) 
> Abandon (core dumped)
> {code}



--
This message was sent by Atlassian Jira
(v8.20.10#820010)