-
-
Notifications
You must be signed in to change notification settings - Fork 18.3k
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
TYP: Replace wildcardimports in toplevelinit as precursor for reshape,stata,io PRs #25936 #25940 #25939 #26019
Conversation
I think you can still import from the apis exposed by each package but just need to list out the object that you are pulling in. Does that no work with Mypy? |
So the only error that mypy throws is this - Theres a lot of other modules in those apis which do not particularly affect the reshape, stata PRs that i am working on but Ive I've included them in in case they need to be imported via top level from other modules in the future. |
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.
this must be very precisely done, IOW importing names explicity as we have tests which exactly guaranteee these imports are no more and no less what is actually imported
b55ca28
to
3dd505e
Compare
3dd505e
to
7aa943b
Compare
Codecov Report
@@ Coverage Diff @@
## master #26019 +/- ##
===========================================
- Coverage 91.82% 40.72% -51.11%
===========================================
Files 175 175
Lines 52536 52536
===========================================
- Hits 48243 21397 -26846
- Misses 4293 31139 +26846
Continue to review full report at Codecov.
|
Codecov Report
@@ Coverage Diff @@
## master #26019 +/- ##
==========================================
- Coverage 91.84% 91.83% -0.01%
==========================================
Files 175 175
Lines 52517 52517
==========================================
- Hits 48233 48228 -5
- Misses 4284 4289 +5
Continue to review full report at Codecov.
|
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.
Looks like there is still one wildcard import for NumPy compat - can you take a look at that here?
from pandas.tseries.api import * | ||
from pandas.core.computation.api import * | ||
from pandas.core.reshape.api import * | ||
from pandas.core.api import ( |
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.
can you organize these by section, e.g. something like
from pandas.core.api import (
# dtype
Int8Dtype.........
# indexes
Int64Index.....
# tseries
NaT, Period.....
# conversion
to_numeric, to_datetime...
# missing
isna, isnul.....
# misc
np, TimeGrouper....
pandas/__init__.py
Outdated
from pandas.io.api import * | ||
|
||
from pandas.io.api import ( | ||
read_clipboard, ExcelFile, ExcelWriter, read_excel, |
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.
can you sort these
…place_wildcardimports_in_toplevelinit_as_precursor_for_reshape,stata,io_PRs_#25936_#25940_#25939
Hello @ryankarlos! Thanks for updating this PR. We checked the lines you've touched for PEP 8 issues, and found: There are currently no PEP 8 issues detected in this Pull Request. Cheers! 🍻 Comment last updated at 2019-04-10 00:38:29 UTC |
1d5cae3
to
e21eb72
Compare
thanks @ryankarlos |
if you’d merge master and update any typing PRs can get them in |
git diff upstream/master -u -- "*.py" | flake8 --diff