Skip to content

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

Merged
ikrommyd merged 1 commit into
scikit-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 into
scikit-hep:mainfrom
ikrommyd:ikrommyd/fix-emptyform-length-check

Conversation

@ikrommyd

@ikrommyd ikrommyd commented Nov 5, 2025

Copy link
Copy Markdown
Member

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

codecov Bot commented Nov 5, 2025

Copy link
Copy Markdown

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.

@ariostas ariostas left a comment

Copy link
Copy Markdown
Member

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

github-actions Bot commented Nov 5, 2025

Copy link
Copy Markdown

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

@ikrommyd

ikrommyd commented Nov 5, 2025

Copy link
Copy Markdown
Member Author

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.

@ianna ianna left a comment

Copy link
Copy Markdown
Member

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