From 0610a60d06c190cdd597480962f98b97de7b4286 Mon Sep 17 00:00:00 2001 From: Gregory Rome Date: Mon, 8 Apr 2019 11:04:07 -0500 Subject: [PATCH] #26020 Fixed type annotations for pandas.plotting._core (#26021) --- mypy.ini | 3 --- pandas/plotting/_core.py | 6 ++++-- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/mypy.ini b/mypy.ini index a528579f34045..ddfa9885e3351 100644 --- a/mypy.ini +++ b/mypy.ini @@ -167,9 +167,6 @@ ignore_errors=True [mypy-pandas.io.stata] ignore_errors=True -[mypy-pandas.plotting._core] -ignore_errors=True - [mypy-pandas.util._doctools] ignore_errors=True diff --git a/pandas/plotting/_core.py b/pandas/plotting/_core.py index cd262dbda6455..96a07fc19eaec 100644 --- a/pandas/plotting/_core.py +++ b/pandas/plotting/_core.py @@ -2,6 +2,7 @@ # pylint: disable=E1101 from collections import namedtuple import re +from typing import List, Optional, Type import warnings import numpy as np @@ -78,7 +79,7 @@ def _kind(self): _layout_type = 'vertical' _default_rot = 0 - orientation = None + orientation = None # type: Optional[str] _pop_attributes = ['label', 'style', 'logy', 'logx', 'loglog', 'mark_right', 'stacked'] _attr_defaults = {'logy': False, 'logx': False, 'loglog': False, @@ -1723,7 +1724,8 @@ def result(self): _all_kinds = _common_kinds + _dataframe_kinds + _series_kinds _klasses = [LinePlot, BarPlot, BarhPlot, KdePlot, HistPlot, BoxPlot, - ScatterPlot, HexBinPlot, AreaPlot, PiePlot] + ScatterPlot, HexBinPlot, AreaPlot, PiePlot] \ + # type: List[Type[MPLPlot]] _plot_klass = {klass._kind: klass for klass in _klasses}