[Enh]: Add shortened aliases for supported __dunder__ methods on expr#2900
[Enh]: Add shortened aliases for supported __dunder__ methods on expr#2900CangyuanLi wants to merge 7 commits intonarwhals-dev:mainfrom
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.