-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Ruff format - polars chaining #9577
Comments
Hy @mlarcane No, there's currently no way to configure method chaining but I know that method chaining has come up before (I also find Ruff's/Black's formatting hard to read). The main challenge with method chaining is that Black/Ruff try very hard to avoid (introducing) parentheses. But method chaining would require parentheses because of Python (a problem other languages don't have). I don't expect us to work on this anytime soon but I'll leave it open and track it as a style discussion. |
There could be magic parentheses (analogous to magic commas) which, if present, would tell the formatter to apply the "call chain style". |
@tmke8 That would be awesome! Really dig the magic commas (for consistency). |
Related to #8598 |
Thanks, @MartinBernstorff, for linking the issue. I did search for it before replying on the issue but failed to find it. I'll close this issue in favour of #8598 |
First of all; thx for providing this neat framework! In our team, we write alot of polars code and we like to chain such that each new polars method "has it's own line" so to speak. We can't seem to find any configurations that allow for this. This is quite a big deal in data science in general, that people like to chain pandas and polars in this way.
Is there anything you can do on this end so it can be configured?
The text was updated successfully, but these errors were encountered: