Skip to content

MyPy cleanup and absolute imports in pandas.core.dtypes.common #21008

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

Merged
merged 5 commits into from
Jun 23, 2018

Conversation

WillAyd
Copy link
Member

@WillAyd WillAyd commented May 11, 2018

Starting the conversation towards #14468

There were a couple misplaced annotations below docstrings that were causing mypy to choke when running:

mypy pandas --ignore-missing-imports

A starred import in pandas.core.dtypes.common was responsible for a lot of complaints from mypy. These were being intentionally suppressed by flake8 but I figure it makes sense to clean up and convert into absolute imports

@WillAyd WillAyd changed the title MyPy cleanup and Abs Imports in dtypes.common MyPy cleanup and Abs Imports in pandas.core.dtypes.common May 11, 2018
ABCIndexClass, ABCDateOffset)
from .inference import is_string_like, is_list_like
from .inference import * # noqa
from pandas.core.dtypes.dtypes import (
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are quite some other places where we use relative imports as well (but of course not consistently ..), but so why change those and not others?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It wasn’t the relative import that mypy was complaining about as much as the starred import. I just figured I’d convert the relative to absolute while I was touching the module

@jorisvandenbossche jorisvandenbossche changed the title MyPy cleanup and Abs Imports in pandas.core.dtypes.common MyPy cleanup and absolute imports in pandas.core.dtypes.common May 11, 2018
@codecov
Copy link

codecov bot commented May 11, 2018

Codecov Report

Merging #21008 into master will decrease coverage by <.01%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master   #21008      +/-   ##
==========================================
- Coverage    91.9%    91.9%   -0.01%     
==========================================
  Files         153      153              
  Lines       49549    49548       -1     
==========================================
- Hits        45539    45538       -1     
  Misses       4010     4010
Flag Coverage Δ
#multiple 90.3% <100%> (-0.01%) ⬇️
#single 41.77% <100%> (-0.01%) ⬇️
Impacted Files Coverage Δ
pandas/core/arrays/base.py 83.95% <ø> (ø) ⬆️
pandas/core/base.py 96.83% <ø> (ø) ⬆️
pandas/core/dtypes/common.py 94.63% <100%> (-0.02%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update aa3e683...60642ed. Read the comment docs.

@jreback jreback added Dtype Conversions Unexpected or buggy dtype conversions Compat pandas objects compatability with Numpy or Python functions labels May 12, 2018
@WillAyd WillAyd closed this May 14, 2018
@WillAyd WillAyd deleted the mypy-start branch May 14, 2018 21:11
@WillAyd WillAyd restored the mypy-start branch May 14, 2018 21:27
@WillAyd WillAyd reopened this May 14, 2018
@jreback jreback added this to the 0.24.0 milestone Jun 19, 2018
@jreback
Copy link
Contributor

jreback commented Jun 19, 2018

looks fine. can you rebase just to be sure. merge on green.

@WillAyd WillAyd merged commit f1aa08c into pandas-dev:master Jun 23, 2018
@WillAyd WillAyd deleted the mypy-start branch June 23, 2018 16:12
Sup3rGeo pushed a commit to Sup3rGeo/pandas that referenced this pull request Oct 1, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Compat pandas objects compatability with Numpy or Python functions Dtype Conversions Unexpected or buggy dtype conversions
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants