Skip to content

fix: only check length against empty form in ak.from_buffers if it is known#3714

Merged
ikrommyd merged 1 commit intoscikit-hep:mainfrom
ikrommyd:ikrommyd/fix-emptyform-length-check
Nov 5, 2025
Merged

fix: only check length against empty form in ak.from_buffers if it is known#3714
ikrommyd merged 1 commit intoscikit-hep:mainfrom
ikrommyd:ikrommyd/fix-emptyform-length-check

Conversation

@ikrommyd
Copy link
Copy Markdown
Collaborator

@ikrommyd ikrommyd commented Nov 5, 2025

We cannot check if the length is zero in the case of EmptyForm if the recursion earlier set it to unknown length. We skip the check in that case.

@ariostas ariostas linked an issue Nov 5, 2025 that may be closed by this pull request
@codecov
Copy link
Copy Markdown

codecov bot commented Nov 5, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 82.72%. Comparing base (b749e49) to head (f635363).
⚠️ Report is 464 commits behind head on main.

Additional details and impacted files
Files with missing lines Coverage Δ
src/awkward/operations/ak_from_buffers.py 94.47% <100.00%> (+0.35%) ⬆️

... and 199 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Copy Markdown
Member

@ariostas ariostas left a comment

Choose a reason for hiding this comment

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

This indeed fixes my issues in Uproot

@github-actions
Copy link
Copy Markdown

github-actions bot commented Nov 5, 2025

The documentation preview is ready to be viewed at http://preview.awkward-array.org.s3-website.us-east-1.amazonaws.com/PR3714

@ikrommyd
Copy link
Copy Markdown
Collaborator Author

ikrommyd commented Nov 5, 2025

This indeed fixes my issues in Uproot

This is naturally skipping a "validity check" that's impossible in this scenario but that's always the case for virtual arrays. You need to assume during array creation that the buffers that are passed in are correct. So the responsibility falls on the person passing the buffers, but that's the best we can do since we cannot look at the data at the from buffers stage.

Copy link
Copy Markdown
Member

@ianna ianna left a comment

Choose a reason for hiding this comment

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

@ikrommyd - great, thanks for fixing it! Please merge it if you are done with it. Thanks.

@ikrommyd ikrommyd merged commit 200e96f into scikit-hep:main Nov 5, 2025
43 checks passed
@ikrommyd ikrommyd deleted the ikrommyd/fix-emptyform-length-check branch November 5, 2025 21:05
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.

from_buffers doesn't work with virtual arrays if there is an EmptyForm

3 participants