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 option-in-record for fill_none #2065

Merged
merged 3 commits into from
Jan 5, 2023

Conversation

agoose77
Copy link
Collaborator

@agoose77 agoose77 commented Jan 5, 2023

Fixes #2064 (see issue for details). I feel like we might have touched upon this before, so keen for comments.

@codecov
Copy link

codecov bot commented Jan 5, 2023

Codecov Report

Merging #2065 (b34431a) into main (8d7a2c3) will increase coverage by 0.00%.
The diff coverage is 100.00%.

Additional details and impacted files
Impacted Files Coverage Δ
src/awkward/operations/ak_fill_none.py 95.00% <100.00%> (+2.31%) ⬆️
src/awkward/contents/bytemaskedarray.py 88.80% <0.00%> (+0.25%) ⬆️

@agoose77 agoose77 temporarily deployed to docs-preview January 5, 2023 02:15 — with GitHub Actions Inactive
@agoose77 agoose77 temporarily deployed to docs-preview January 5, 2023 07:38 — with GitHub Actions Inactive
@agoose77 agoose77 changed the title fix: mirror is_none in fill_none fix: support option-in-record for fill_none Jan 5, 2023
@agoose77 agoose77 force-pushed the agoose77/fix-fill-none-record branch from f4b02e8 to b34431a Compare January 5, 2023 21:32
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.

Some operations that used to act on data within records have been stopped at the RecordArray border, but I see no reason why this one should be. As a user, I would expect to be able to say ak.fill_none on an array containing records and have the missing values in the records get filled in.

It has to respect the axis parameter, but it looks like it does.

I'd say this is ready to merge.

@agoose77
Copy link
Collaborator Author

agoose77 commented Jan 5, 2023

@jpivarski let me just test one additional case! I'm sorry for pinging you and then pausing the merge; I noticed something peculiar.

@agoose77
Copy link
Collaborator Author

agoose77 commented Jan 5, 2023

OK, the peculiarity I noticed was if the record contains options, and the record itself is wrapped in an option. This PR does what is_none does; the first wins.

@agoose77 agoose77 merged commit f632798 into main Jan 5, 2023
@agoose77 agoose77 deleted the agoose77/fix-fill-none-record branch January 5, 2023 22:06
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.fill_none doesn't support option-in-record
2 participants