Skip to content

fix: fix and test Form.length_zero/one_array()#3810

Merged
pfackeldey merged 8 commits intoscikit-hep:mainfrom
ikrommyd:fix-length-one-array
Jan 22, 2026
Merged

fix: fix and test Form.length_zero/one_array()#3810
pfackeldey merged 8 commits intoscikit-hep:mainfrom
ikrommyd:fix-length-one-array

Conversation

@ikrommyd
Copy link
Copy Markdown
Collaborator

@ikrommyd ikrommyd commented Jan 19, 2026

Fixes #3808

While testing, I found many other issues too (half of the added tests pass on main). This fixes them and tests them.

@codecov
Copy link
Copy Markdown

codecov bot commented Jan 19, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 82.67%. Comparing base (1b7e3d6) to head (5f2d776).
⚠️ Report is 4 commits behind head on main.

Additional details and impacted files
Files with missing lines Coverage Δ
src/awkward/forms/form.py 90.52% <100.00%> (+9.21%) ⬆️
src/awkward/operations/ak_from_buffers.py 93.36% <100.00%> (ø)

... and 5 files with indirect coverage changes

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

@ikrommyd ikrommyd requested a review from pfackeldey January 19, 2026 18:34
@github-actions
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/PR3810

@ikrommyd ikrommyd marked this pull request as draft January 19, 2026 19:06
@ikrommyd
Copy link
Copy Markdown
Collaborator Author

There's still some problems

@ikrommyd
Copy link
Copy Markdown
Collaborator Author

I found the current logic with prepare and prepare_empty to be fault especially with nested forms. I think implementing a single prepare recursive function that follows the same logic as from_buffers is the right way to go here.

@ikrommyd ikrommyd changed the title fix: fix Form.length_zero/one_array() and add tests fix: fix and test Form.length_zero/one_array() Jan 20, 2026
@ikrommyd ikrommyd marked this pull request as ready for review January 20, 2026 00:33
Copy link
Copy Markdown
Collaborator

@pfackeldey pfackeldey left a comment

Choose a reason for hiding this comment

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

Thanks @ikrommyd, this fixes and allows way more length 0/1 creations from forms than before. This is only needed in 'side-stepping typetracer code' with dak.map_partitions, so could you quickly confirm that this doesn't break any existing tests we have in coffea (and maybe dask-awkward)?

@ikrommyd
Copy link
Copy Markdown
Collaborator Author

Thanks @ikrommyd, this fixes and allows way more length 0/1 creations from forms than before. This is only needed in 'side-stepping typetracer code' with dak.map_partitions, so could you quickly confirm that this doesn't break any existing tests we have in coffea (and maybe dask-awkward)?

I have ran dask-awkward, uproot, and coffea tests locally with this with no issues. Integration tests CI will test it even better after merging too.

@pfackeldey
Copy link
Copy Markdown
Collaborator

Thanks for checking! 👍

@pfackeldey pfackeldey merged commit 7661d5a into scikit-hep:main Jan 22, 2026
71 of 75 checks passed
@ikrommyd ikrommyd deleted the fix-length-one-array branch February 3, 2026 17:53
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.

Can't create length one array out of RegularForm with IndexedOptionForm content

2 participants