Skip to content

GH-38768: [Python] Slicing an array backwards beyond the start now includes first item.#39240

Merged
jorisvandenbossche merged 1 commit intoapache:mainfrom
LucasG0:slice_beyond_start_negativ_step
Mar 15, 2024
Merged

GH-38768: [Python] Slicing an array backwards beyond the start now includes first item.#39240
jorisvandenbossche merged 1 commit intoapache:mainfrom
LucasG0:slice_beyond_start_negativ_step

Conversation

@LucasG0
Copy link
Copy Markdown
Contributor

@LucasG0 LucasG0 commented Dec 15, 2023

What changes are included in this PR?

Minor changes in _normalize_slice so start and stop are both computed in a single if/else block instead of having them modified later in case of a negative step.

Are these changes tested?

Yes.

Are there any user-facing changes?

Fixing wrong data returned in an edge case.

@pitrou
Copy link
Copy Markdown
Member

pitrou commented Feb 6, 2024

@jorisvandenbossche Would you be available to review this?

Copy link
Copy Markdown
Member

@jorisvandenbossche jorisvandenbossche left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry for the delayed review, but this looks good to me. Thanks a lot for the contribution!

@jorisvandenbossche jorisvandenbossche merged commit 00a4821 into apache:main Mar 15, 2024
@jorisvandenbossche jorisvandenbossche removed the awaiting review Awaiting review label Mar 15, 2024
@github-actions github-actions bot added the awaiting merge Awaiting merge label Mar 15, 2024
@conbench-apache-arrow
Copy link
Copy Markdown

After merging your PR, Conbench analyzed the 7 benchmarking runs that have been run so far on merge-commit 00a4821.

There were no benchmark performance regressions. 🎉

The full Conbench report has more details. It also includes information about 107 possible false positives for unstable benchmarks that are known to sometimes produce them.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Python] Slicing an array backwards beyond the start doesn't include first item

3 participants