-
-
Notifications
You must be signed in to change notification settings - Fork 17.9k
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 in tests: pandas.util.testing as tm #29272
Comments
After investigating a few files manually, I think this should be (mostly) scriptable:
|
3 tasks
I came up with the following script which should solve the problem pretty well (+should be rather straight forward to adjust to other use cases):
I'll open a few PRs for the remaining files :) |
This was referenced Oct 30, 2019
This was referenced Oct 30, 2019
gfyoung
pushed a commit
that referenced
this issue
Oct 31, 2019
gfyoung
pushed a commit
that referenced
this issue
Oct 31, 2019
gfyoung
pushed a commit
that referenced
this issue
Oct 31, 2019
gfyoung
pushed a commit
that referenced
this issue
Oct 31, 2019
gfyoung
pushed a commit
that referenced
this issue
Oct 31, 2019
This was referenced Oct 31, 2019
Reksbril
pushed a commit
to Reksbril/pandas
that referenced
this issue
Nov 18, 2019
Reksbril
pushed a commit
to Reksbril/pandas
that referenced
this issue
Nov 18, 2019
Reksbril
pushed a commit
to Reksbril/pandas
that referenced
this issue
Nov 18, 2019
Reksbril
pushed a commit
to Reksbril/pandas
that referenced
this issue
Nov 18, 2019
Reksbril
pushed a commit
to Reksbril/pandas
that referenced
this issue
Nov 18, 2019
proost
pushed a commit
to proost/pandas
that referenced
this issue
Dec 19, 2019
proost
pushed a commit
to proost/pandas
that referenced
this issue
Dec 19, 2019
proost
pushed a commit
to proost/pandas
that referenced
this issue
Dec 19, 2019
proost
pushed a commit
to proost/pandas
that referenced
this issue
Dec 19, 2019
proost
pushed a commit
to proost/pandas
that referenced
this issue
Dec 19, 2019
proost
pushed a commit
to proost/pandas
that referenced
this issue
Dec 19, 2019
proost
pushed a commit
to proost/pandas
that referenced
this issue
Dec 19, 2019
proost
pushed a commit
to proost/pandas
that referenced
this issue
Dec 19, 2019
proost
pushed a commit
to proost/pandas
that referenced
this issue
Dec 19, 2019
proost
pushed a commit
to proost/pandas
that referenced
this issue
Dec 19, 2019
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This is a follow-up issue of #23018 with the goal of enforcing a consistent approach of importing things from pandas.util.testing inside the test suite.
Currently, there are multiple import styles used:
import pandas.util.testing as tm
from pandas.util.testing import ...
from pandas.util import testing as tm
As it is already the dominant import style used and also less prone to circular imports 1. is the prefered option. After migrating all current occurrences of 2. and 3. we'll add a linting rule that enforces this convention.
These are the current files that use 2. (generated with
grep -R -l --include="*.py" "from pandas.util.testing import " pandas/tests
:The text was updated successfully, but these errors were encountered: