-
Notifications
You must be signed in to change notification settings - Fork 36
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
feat: add all methods of RPolarsExpr to RPolarsSeries #831
Conversation
@etiennebacher I would like to merge this for a new release. Could you help me merge it? |
I can review in a couple of hours |
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.
That looks good to me, thanks!
Now that the method dispatch is made automatically, can you remove the old implementation of the methods for Series
? For example it's no longer necessary to implement Series_add
ourselves. Note however that some methods cannot be removed because they should return a scalar and not a Series
(e.g $sum()
, $mean()
...)
Of course it is possible, but most of the existing methods look like thin wrappers for Rust Polars, so I think it might as well be left as they are. In other words, what is here needs to be implemented on the Rust side as before, but the rest needs to be brought in from Expr. |
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.
I get that some methods must be implemented in Rust because either they don't have equivalent in Expr or the Expr method would return a Series instead of a scalar. But other Series methods could simply be removed from the Rust and R sides and nothing would change, e.g $floor()
, $ceiling()
.
I don't want this to be a blocker for this PR, but I think we should get rid of them to reduce the codebase.
Apart from that, thank you for this PR, it's super useful to dispatch methods like this |
Thanks for reviewing this. I will merge it and release it. |
Sorry, the commit comment for the merge commit was broken due to browser behavior. |
Instead of the experimental
<Series>$expr$<method>
, we can call methods that exist only in Expr with<Series>$<method>
.