-
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
Rule C416 broke some pandas code #4491
Comments
Huh, interesting. It's not immediately clear to me why / how those are different. |
FWIW it's fixed by wrapping the import pandas as pd
obj = dict(iter(pd.DataFrame.from_records([], columns=["foo", "bar", "baz"]).groupby("foo"))) or using the splat import pandas as pd
obj = dict(*pd.DataFrame.from_records([], columns=["foo", "bar", "baz"]).groupby("foo")) |
The splat |
Interesting...
|
This snippit:
Is rewritten to the following using the C416 rule (no unnecessary comprehensions):
However that generates a TypeError when I run it. I filed a bug about this upstream (see pandas-dev/pandas#53287) but it makes me wonder if this rule is safe to apply. Current using ruff 0.0.262.
The text was updated successfully, but these errors were encountered: