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: support empty record arrays in ak.to_numpy #2012

Merged
merged 2 commits into from
Dec 15, 2022

Conversation

agoose77
Copy link
Collaborator

Fixes #1944

@agoose77 agoose77 requested review from jpivarski and ioanaif and removed request for jpivarski December 15, 2022 12:59
@codecov
Copy link

codecov bot commented Dec 15, 2022

Codecov Report

Merging #2012 (c2d387c) into main (1f1690f) will not change coverage.
The diff coverage is n/a.

Additional details and impacted files
Impacted Files Coverage Δ
src/awkward/contents/recordarray.py 84.32% <ø> (ø)

@agoose77 agoose77 temporarily deployed to docs-preview December 15, 2022 13:12 — 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.

Absolutely! (RecordArray didn't originally have a length independent of its contents. It was added so that records with zero fields would at least be representable, but there are vestiges like this one in which contents, rather than the length, is used.)

@jpivarski jpivarski merged commit 4e67d59 into main Dec 15, 2022
@jpivarski jpivarski deleted the agoose77/fix-to-numpy-empty-recordarray branch December 15, 2022 14:13
agoose77 added a commit that referenced this pull request Dec 15, 2022
* test: add test

* fix: fix `ak.to_numpy([{}])`
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.

ak.to_numpy() fails cryptically for ak.Array([{}])
2 participants