Uploaded image for project: 'Apache Arrow'
  1. Apache Arrow
  2. ARROW-12769

[Python] Negative out of range slices yield invalid arrays

Attach filesAttach ScreenshotVotersWatch issueWatchersCreate sub-taskLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    Description

      Tested on pyarrow 2.0 and pyarrow 4.0 wheels.  The errors are slightly different between the 2.0.  Below is a script from 4.0

       

      This is taken from the result of test_slice_array

       
      {{ >>> import pyarrow as pa}}
      {{ >>> pa.array(range(0,10))}}
      {{ <pyarrow.lib.Int64Array object at 0x7f59b8bdab20>}}
      {{ [}}
      {{ 0,}}
      {{ 1,}}
      {{ 2,}}
      {{ 3,}}
      {{ 4,}}
      {{ 5,}}
      {{ 6,}}
      {{ 7,}}
      {{ 8,}}
      {{ 9}}
      {{ ]}}
      {{ >>> a=pa.array(range(0,10))}}
      {{ >>> a[-9:-20]}}
      {{ <pyarrow.lib.Int64Array object at 0x7f59b8bdaa00>}}
      {{ []}}
      {{ >>> len(a[-9:-20])}}
      {{ Traceback (most recent call last):}}
      {{ File "<stdin>", line 1, in <module>}}
      {{ SystemError: <built-in function len> returned NULL without setting an error}}

      Attachments

        Issue Links

        Activity

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

            jorisvandenbossche Joris Van den Bossche
            emkornfield Micah Kornfield
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Time Tracking

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0h
                0h
                Logged:
                Time Spent - 1h
                1h

                Slack

                  Issue deployment