Skip to content

fix: ArrayBuilder.__bool__ raises TypeError when builder length is 1#3738

Merged
ianna merged 3 commits intoscikit-hep:mainfrom
T90REAL:fix-3732
Nov 26, 2025
Merged

fix: ArrayBuilder.__bool__ raises TypeError when builder length is 1#3738
ianna merged 3 commits intoscikit-hep:mainfrom
T90REAL:fix-3732

Conversation

@T90REAL
Copy link
Copy Markdown
Collaborator

@T90REAL T90REAL commented Nov 18, 2025

Closes #3732

The implementation explicitly checks len(self) == 1, but then attempts to access self[0], even though ArrayBuilder does not implement __getitem__. Change it to fetch the value from the snapshot instead.

@T90REAL T90REAL changed the title fix: ArrayBuilder is not subscriptable, fetch the value from the snapshot instead. fix: ArrayBuilder.__bool__ raises TypeError when builder length is 1 Nov 18, 2025
@codecov
Copy link
Copy Markdown

codecov bot commented Nov 24, 2025

Codecov Report

❌ Patch coverage is 0% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 82.71%. Comparing base (b749e49) to head (87c5496).
⚠️ Report is 473 commits behind head on main.

Files with missing lines Patch % Lines
src/awkward/highlevel.py 0.00% 1 Missing ⚠️
Additional details and impacted files
Files with missing lines Coverage Δ
src/awkward/highlevel.py 78.30% <0.00%> (+1.63%) ⬆️

... 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.

@ianna
Copy link
Copy Markdown
Member

ianna commented Nov 24, 2025

@all-contributors please add @T90REAL for code

@allcontributors
Copy link
Copy Markdown
Contributor

@ianna

I've put up a pull request to add @T90REAL! 🎉

@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/PR3738

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.

@T90REAL - Great! Thanks for fixing it! Please, squash and merge it. Thanks.

@ianna ianna merged commit f2e18e6 into scikit-hep:main Nov 26, 2025
43 checks passed
ikrommyd pushed a commit to ikrommyd/awkward that referenced this pull request Dec 9, 2025
…is 1 (scikit-hep#3738)

is not subscriptable, fetch the value from the snapshot instead.

Co-authored-by: Ianna Osborne <ianna.osborne@cern.ch>
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.

ArrayBuilder.__bool__ raises TypeError when builder length is 1

2 participants