-
-
Notifications
You must be signed in to change notification settings - Fork 18.5k
CLN: Consistent imports - linting rules #29318
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
CLN: Consistent imports - linting rules #29318
Conversation
invgrep -R --include="*.py*" -E "from pandas.core.common import" pandas | ||
invgrep -R --include="*.py*" -E "from pandas.core import common" pandas | ||
invgrep -R --include="*.py*" -E "from collections.abc import" pandas | ||
invgrep -R --include="*.py*" -E "from numpy import nan" pandas |
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 removed the trailing spaces in the import strings to make them more robust to multi-line imports.
Also for the from numpy import nan
import they didn't make sense at all. It doesn't seem to be valid syntax anymore though, so it doesn't require any additional clean up
invgrep -R --include="*.py*" -E "from collections.abc import " pandas | ||
invgrep -R --include="*.py*" -E "from numpy import nan " pandas | ||
invgrep -R --include="*.py*" -E "from pandas.core.common import" pandas | ||
invgrep -R --include="*.py*" -E "from pandas.core import common" pandas |
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 noticed the pattern from pandas.core import common as com
is used in the code base as an alternative to the desired import pandas.core.common as com
. Therefore I fixed the existing cases (not a breaking change) and added this linting rule here. Let me know if that's fine with you or if this should rather go into a separate PR 🙂✌️
thanks @SaturnFromTitan very nice! |
black pandas
git diff upstream/master -u -- "*.py" | flake8 --diff