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 a @passmissing
flag, only with @byrow
for now.
#272
Conversation
Also index.md needs an update I think (as it currently mentions |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! @bkamins I just pushed the index.md stuff as well.
So all the moving parts are done and if it looks good it can be merged.
docs/src/index.md
Outdated
@@ -21,6 +21,7 @@ In addition, DataFramesMeta provides | |||
* `@eachrow` and `@eachrow!` for looping through rows in data frame, again with high performance and | |||
convenient syntax. | |||
* `@byrow` for applying functions to each row of a data frame (only supported inside other macros). | |||
* `@passmissing` for propagating missing values inside DataFramesMeta.jl transformations. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
in line 6: DataFramesMeta.jl (I cannot correct it in the editor)
docs/src/index.md
Outdated
@@ -21,6 +21,7 @@ In addition, DataFramesMeta provides | |||
* `@eachrow` and `@eachrow!` for looping through rows in data frame, again with high performance and | |||
convenient syntax. | |||
* `@byrow` for applying functions to each row of a data frame (only supported inside other macros). | |||
* `@passmissing` for propagating missing values inside DataFramesMeta.jl transformations. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
row-wise transformations?
docs/src/index.md
Outdated
Missings.jl provides the `passmissing` function-wrapper to help get around these | ||
roadblocks: `passmissing(f)(args...)` will return `missing` if any of `args` is | ||
missing. Similarly, DataFramesMeta.jl provides the `@passmissing` function to wrap | ||
the anonymous functions created by DataFramesMeta.jl in `Missings.passmissing`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
row-wise
function check_macro_flags_consistency(exprflags) | ||
if exprflags[PASSMISSING_SYM][] | ||
if !exprflags[BYROW_SYM][] | ||
s = "The `@passmissing` flag is currently only allowed with the `@byrow` flag" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do you test against this case?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added.
fun = :(ByRow($fun)) | ||
if exprflags[BYROW_SYM][] | ||
if exprflags[PASSMISSING_SYM][] | ||
fun = :(ByRow(Missings.passmissing($fun))) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks good performance wise :).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good. I approve, but after fixing my minor comments you can ping me and I can have a look again.
Co-authored-by: Bogumił Kamiński <bkamins@sgh.waw.pl>
Thanks! |
No description provided.