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

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

pitrou commented on issue #1723: ARROW-2288: [Python] Fix slicing logic
URL: https://github.com/apache/arrow/pull/1723#issuecomment-371470276
 
 
   AppVeyor at https://ci.appveyor.com/project/pitrou/arrow/build/1.0.173

----------------------------------------------------------------
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


> [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
>
> 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
(v7.6.3#76005)

Reply via email to