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

add .allow_na in keep and discard to prevent error with NAs in .x #1171

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

sierrajohnson
Copy link

fixes #1156

Not sure I've implemented the right solution.

The error comes from the as_predicate function when NA is returned. The function can have .allow_na=TRUE to account for this. But that messes with some other logic when passed all the way through - this test was set up expecting an error:
keep(1:3), ~NA
I added an ifelse to keep that test passing, but it could still change behavior.

Alternatively, .allow_na could become an argument in keep , but I see it's not an exported argument anywhere else, so I was hesitant to put it in.

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.

keep() and discard() err on NA ... perhaps unintentionally?
1 participant