Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: boolean indexing with non-zero starting offsets #2216

Merged
merged 3 commits into from
Feb 7, 2023

Conversation

agoose77
Copy link
Collaborator

@agoose77 agoose77 commented Feb 7, 2023

Fixes #2214

The fix here is simplest if we start the ListOffsetArray at zero. This should not copy anything besides offsets for the list-of-NumPy case. There are other places in this region of the codebase that might also have this bug, but I'd prefer to wait for bug reports.

@agoose77 agoose77 requested a review from jpivarski February 7, 2023 10:32
@agoose77 agoose77 temporarily deployed to docs-preview February 7, 2023 10:46 — with GitHub Actions Inactive
@codecov
Copy link

codecov bot commented Feb 7, 2023

Codecov Report

Merging #2216 (86f42dc) into main (339896f) will increase coverage by 0.00%.
The diff coverage is 100.00%.

Additional details and impacted files
Impacted Files Coverage Δ
...rc/awkward/operations/ak_merge_union_of_records.py 88.70% <ø> (ø)
src/awkward/_slicing.py 88.88% <100.00%> (+0.04%) ⬆️

@agoose77 agoose77 temporarily deployed to docs-preview February 7, 2023 12:32 — with GitHub Actions Inactive
Copy link
Member

@jpivarski jpivarski left a comment

Choose a reason for hiding this comment

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

That starts_with_zero argument allows us to trade ease of implementation for performance (probably not much). It's definitely a good way to fix a bug like this!

@jpivarski jpivarski merged commit d6dacea into main Feb 7, 2023
@jpivarski jpivarski deleted the agoose77/fix-boolean-index branch February 7, 2023 17:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

IndexError: boolean index did not match indexed array in awkward 2.x vs 1.x
2 participants