-
Notifications
You must be signed in to change notification settings - Fork 166
[Enh]: Add shortened aliases for supported __dunder__ methods on expr #2900
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
base: main
Are you sure you want to change the base?
Conversation
Hi all, thanks for bearing with me on my first PR! Pre-commit is failing because there are methods on Expr that are not on Series. What is narwhal's policy on breaking from the polars API? In polars, these methods are only implemented on Expr, not Series. |
Hey @CangyuanLi thanks for taking the initiative ๐๐ผ
You can add these methods in narwhals/utils/check_api_reference.py Line 63 in f99778e
|
thanks for your pr! sorry, I forgot to reply to the issue tbh I'm not totally sure about these. You can already type out on the other hand, these are nice to have documented, whereas it's a bit awkward to document the i'll think about this a little more |
Thank you! I agree that its more of a nice-to-have. My argument in favor would be that it makes reasoning about the order of operations much faster (at least for me). Calling the dunder methods does that as well but does introduce visual clutter. |
What type of PR is this? (check all applicable)
Related issues
Expr
ย #2213Checklist
If you have comments or can explain your changes, please do so below
This PR adds shortened aliases (e.g.
sub
,lt
) for supported binary operators (e.g. sub, lt), mimicing the Polars API. This makes method chaining much more convenient.