-
Notifications
You must be signed in to change notification settings - Fork 37
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: The Extract function should filter rows before selecting columns #547
Conversation
I wonder how much of the base R syntax we want to support in |
I see your point. But I basically think that defining S3 methods for base R functions should be done in this package. (The exception is functions that use NSE which should use |
I'm completely fine with defining the S3 methods here ( When I look at the diff, I see that it was already possible to filter rows with with |
This PR basically just swaps the order of select and filter. |
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.
Alright so even if we want to discuss more about the S3 methods, this can be done in an issue, this PR is not really related. Thanks!
Thanks for looking at this. I have a complaint that method chaining with Also, since the Polars API is subject to potentially breaking changes (e.g., the change from |
What would the advantage of |
This is the simplest example. In practice, it would look something like this: foo |>
bar() |>
pl$LazyFrame() # <- We can't pipe after this |
For base data.frame, it is possible to filter on columns that are not included in the result, such as
mtcars[mtcars$cyl >= 8, c("disp", "mpg")]
, but until now this was not possible with polars DataFrame because column selection was performed first.This PR fixes this behavior by filtering first and also allows filtering by Expr for LazyFrame.