Skip to content

TYP: annotations in pandas.plotting #35935

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 18 commits into from
Aug 28, 2020

Conversation

jbrockmendel
Copy link
Member

No description provided.

jbrockmendel and others added 18 commits August 20, 2020 21:19
from pandas.core.dtypes.common import is_list_like
from pandas.core.dtypes.generic import ABCDataFrame, ABCIndexClass, ABCSeries

from pandas.plotting._matplotlib import compat

if TYPE_CHECKING:
from matplotlib.table import Table
Copy link
Member

Choose a reason for hiding this comment

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

Revealed type is 'Any'

not sure what's best here. I imagine that once we get np.ndarray imports sorted, there'll be a lot of mypy errors to fix. I wonder whether we want to continue adding types that currently resolve to Any or leave untyped.

Copy link
Member Author

Choose a reason for hiding this comment

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

ill follow your lead on this.

there are a lot of places in pd.plotting where we have a ax arg that would be nice to disambiguate pd.Index vs matplotlib.axes.Axes vs matplotlib.axis.Axis (i think most are Axes)

Copy link
Member Author

Choose a reason for hiding this comment

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

once we get np.ndarray imports sorted

is there cause for optimism this may be soon-ish?

Copy link
Member

Choose a reason for hiding this comment

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

I'm not sure that we have got to any technical blocks yet since not much effort in this direction. Personally, I wanted to get the check_untyped_defs sorted first. (was a phase 0 in a plan) that imo comes before all other work. but in open source can't control the effort and therefore some have a preference for typing the public api. My interest in typing has always been for the internal consistency and quality of the pandas codebase itself.

But with hindsight, getting typing PRs through was so painfull that any typing additions is a bonus.

@simonjayhawkins simonjayhawkins added the Typing type annotations, mypy/pyright type checking label Aug 27, 2020
@simonjayhawkins simonjayhawkins added this to the 1.2 milestone Aug 27, 2020
@simonjayhawkins simonjayhawkins merged commit 1f35b06 into pandas-dev:master Aug 28, 2020
@simonjayhawkins
Copy link
Member

Thanks @jbrockmendel

@jbrockmendel jbrockmendel deleted the annotate-plotting-2 branch August 28, 2020 17:09
AlexKirko pushed a commit to AlexKirko/pandas that referenced this pull request Aug 31, 2020
kesmit13 pushed a commit to kesmit13/pandas that referenced this pull request Nov 2, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Typing type annotations, mypy/pyright type checking
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants