Skip to content

[Python] BUG: Empty slicing an array backwards beyond the start should be empty #40642

@mroeschke

Description

@mroeschke

Describe the bug, including details regarding any error messages, version, and platform.

I think post #39240, slicing with an empty slice under the same conditions returns the first element when the result should be empty

In [14]: import pyarrow as pa
    ...: print(pa.__version__)
    ...: array = pa.chunked_array([list("abcde")])
    ...: array[slice(-6, -6, -1)]
16.0.0.dev318
Out[14]: 
<pyarrow.lib.ChunkedArray object at 0x11a1ce4d0>
[
  [
    "a"
  ]
]

In [15]: list("abcde")[slice(-6, -6, -1)]
Out[15]: []

cc @LucasG0 @jorisvandenbossche

Component(s)

Python

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions