You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Python] BUG: Empty slicing an array backwards beyond the start should be empty #40642
Using slices.indices seems to be a good call, thanks @jorisvandenbossche. I do not think still having negative values is an issue here, I created #40682.
changed the title [-]BUG: Empty slicing an array backwards beyond the start should be empty[/-][+][Python] BUG: Empty slicing an array backwards beyond the start should be empty[/+]on Mar 20, 2024
Moved this back to 16.0, because it is a regression that we caused ourselves that for now only lives on main, so we can prevent this gets released. Will look into updating/merging the PR.
@raulcd not fully familiar with the cherry-picking script, but the PR was pointing to an older already closed issues, and I only renamed it to point to this issue after merging with the merge script. Just mentioning in case that might affect it getting picked up by the backporting.
@jorisvandenbossche this has been cherry-picked to the 16.0.0 maintenance branch. The cherry-pick script picked it up without further action on my side.
Activity
jorisvandenbossche commentedon Mar 19, 2024
Thanks for the catch! Yet another annoying corner case ..
I was wondering if there isn't some existing functionality to "normalize" slice objects, and https://stackoverflow.com/questions/6246084/sanitize-python-slice pointed to https://docs.python.org/3/reference/datamodel.html#slice.indices
We could test if that helps for us. Although for the case above it still gives negative start/stop values .. :
jorisvandenbossche commentedon Mar 19, 2024
(and so this case actually worked before, so going to mark as critical for 16.0)
LucasG0 commentedon Mar 20, 2024
Using
slices.indicesseems to be a good call, thanks @jorisvandenbossche. I do not think still having negative values is an issue here, I created #40682.[-]BUG: Empty slicing an array backwards beyond the start should be empty[/-][+][Python] BUG: Empty slicing an array backwards beyond the start should be empty[/+]raulcd commentedon Apr 9, 2024
I am moving this to 17.0.0. Let me know if this is required for the 16.0.0 release.
jorisvandenbossche commentedon Apr 9, 2024
Moved this back to 16.0, because it is a regression that we caused ourselves that for now only lives on main, so we can prevent this gets released. Will look into updating/merging the PR.
GH-38768: [Python] Empty slicing an array backwards beyond the start …
jorisvandenbossche commentedon Apr 9, 2024
Resolved by #40682
jorisvandenbossche commentedon Apr 9, 2024
@raulcd not fully familiar with the cherry-picking script, but the PR was pointing to an older already closed issues, and I only renamed it to point to this issue after merging with the merge script. Just mentioning in case that might affect it getting picked up by the backporting.
GH-38768: [Python] Empty slicing an array backwards beyond the start …
raulcd commentedon Apr 10, 2024
@jorisvandenbossche this has been cherry-picked to the 16.0.0 maintenance branch. The cherry-pick script picked it up without further action on my side.
apacheGH-38768: [Python] Empty slicing an array backwards beyond the …