Details

      Description

      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:

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

      Also note this crash:

      >>> arr[10:13]
      /home/antoine/arrow/cpp/src/arrow/array.cc:105 Check failed: (offset) <= (data.length) 
      Abandon (core dumped)
      

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                pitrou Antoine Pitrou
                Reporter:
                pitrou Antoine Pitrou
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: