diff --git a/pandas/plotting/_matplotlib/__init__.py b/pandas/plotting/_matplotlib/__init__.py index f9a692b0559ca..27b1d55fe1bd6 100644 --- a/pandas/plotting/_matplotlib/__init__.py +++ b/pandas/plotting/_matplotlib/__init__.py @@ -1,3 +1,5 @@ +from typing import TYPE_CHECKING, Dict, Type + from pandas.plotting._matplotlib.boxplot import ( BoxPlot, boxplot, @@ -26,7 +28,10 @@ ) from pandas.plotting._matplotlib.tools import table -PLOT_CLASSES = { +if TYPE_CHECKING: + from pandas.plotting._matplotlib.core import MPLPlot # noqa: F401 + +PLOT_CLASSES: Dict[str, Type["MPLPlot"]] = { "line": LinePlot, "bar": BarPlot, "barh": BarhPlot, diff --git a/setup.cfg b/setup.cfg index 1484198929973..9f21aa40f694a 100644 --- a/setup.cfg +++ b/setup.cfg @@ -331,9 +331,6 @@ check_untyped_defs=False [mypy-pandas.plotting._matplotlib.misc] check_untyped_defs=False -[mypy-pandas.plotting._matplotlib.timeseries] -check_untyped_defs=False - [mypy-pandas.tseries.holiday] check_untyped_defs=False