-
Notifications
You must be signed in to change notification settings - Fork 55
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 row-wise macros #267
Add row-wise macros #267
Conversation
Just finishing adding the macros, will add tests tomorrow (should be easy, just the same as the |
Okay I've updated tests and docstrings and a little bit of One question for @bkamins and @nalimilan: Should we deprecate
Given that this can more easily be written as |
The question is if it hurts to have it. I understand that we keep |
Sorry, I should have been clearer. I mean
That is, when |
Yes - I have understood it. And I meant that as long as we accept |
@@ -595,6 +621,21 @@ function subset!_helper(x, args...) | |||
end | |||
end | |||
|
|||
function rsubset!_helper(x, args...) |
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.
Would there be a way to avoid duplicating these helper functions, for example by passing subset
or subset!
to a more generic one?
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.
Yes, that't what DataFrameMacros does. I will do this in a future PR.
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.
Why not do it now? :-p
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.
Okay I've simplified the @byrow
check but it's hard to actually make everything in a coherent function
- The ugly
t = (fun_to_vec(ex; no_dest=true, outer_flags=outer_flags) for ex in exprs)
can't be gotten rid of yet because we still need to support some deprecated functionality in@combine
. - There are lots of exceptions, for example
@subset
requires a keyword argument,@orderby
doesn't even call a DataFrames function. Writing a function for these cases would be just as easy as writing out the expression.
Co-authored-by: Milan Bouchet-Valat <[email protected]>
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.
Okay I think this is also ready for merging!
@nalimilan @bkamins as Milan noted there is some technical debt here but it can be re-worked in a future PR.
@@ -595,6 +621,21 @@ function subset!_helper(x, args...) | |||
end | |||
end | |||
|
|||
function rsubset!_helper(x, args...) |
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.
Yes, that't what DataFrameMacros does. I will do this in a future PR.
As commented in #270 maybe we need |
Maybe I should restrict the row-wise macros to only work on |
I think it is ok for row-wise macros to work also on |
If I do not do a final review of this PR in 2 days from now please ping me (I cannot do it now). |
Yes I'm sorry I wasn't there to help field questions. I should have offered. |
Thank you for posting this. Actually I have not expected so many questions (but probably it is a good sign that there were so many questions). I was swamped during the first hour, but then I learned how to sort them. |
Thank you for the review! I have responded to comments. |
Co-authored-by: Milan Bouchet-Valat <[email protected]>
Sorry about the typos. This is ready to be merged, then. |
Okay the merge was actually very easy and there were no conflicts. I will merge this! |
No description provided.