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

@subset should have implicit skipmissing = true, or provide an option to specify #7

Closed
tobi-lipede-oodle opened this issue Jun 29, 2021 · 4 comments

Comments

@tobi-lipede-oodle
Copy link

This is an awesome package :) - I really like the 'rowwise by default' operations.

Currently @subset will fail for a simple :col == X predicate if :col contains missing values. I think that for most users it might be preferable to have skipmissing set to true by default. Or failing that to allow a skipmissing option. There is of course the third option of the user writing something like ismissing(:col) ? false : :col == X, but that makes things more verbose

@jkrumbiegel
Copy link
Owner

jkrumbiegel commented Jun 29, 2021

you can use keywords with all macros, so @subset(df, :col == X; skipmissing = true) should work. It currently only works with the parentheses macro syntax because of the way parsing of keyword arguments works. And I've noticed that it doesn't currently work with Chain.jl when leaving out the first parameter, because the keyword arguments technically come before the positional arguments and I hadn't considered that at the time. I still want to add that to Chain.jl, though.

And maybe I'll put in a shortcut for skipmissing = true because I'm also annoyed by it, but I have to think that through first.

@tobi-lipede-oodle
Copy link
Author

Ahh I see, thanks for the quick response! Yeah I was getting caught out when using the Chain.jl workflow. The following seems to work:

@subset(_, predicates...; kwargs...)

@jkrumbiegel
Copy link
Owner

Macro keyword arguments work now in Chain.jl jkrumbiegel/Chain.jl#31

@tobi-lipede-oodle
Copy link
Author

Oh wow awesome thanks!

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

No branches or pull requests

2 participants