Antoine Pitrou created ARROW-2288:
-------------------------------------

             Summary: [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


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