From c9ff68fc68953260f0925578b9c3d786b2732355 Mon Sep 17 00:00:00 2001 From: Gregory Rome Date: Sun, 7 Apr 2019 10:17:39 -0500 Subject: [PATCH 1/2] #26020 Fixed type annotations for pandas.plotting._core --- mypy.ini | 3 --- pandas/plotting/_core.py | 6 ++++-- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/mypy.ini b/mypy.ini index 62a3d535b561a..91d923503b68c 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.tseries.frequencies] 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} From b92dee9e30795007d1b89982e99cf2d5133c0b4f Mon Sep 17 00:00:00 2001 From: Gregory Rome Date: Mon, 8 Apr 2019 00:17:15 -0500 Subject: [PATCH 2/2] Actually merge mypy.ini this time --- mypy.ini | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/mypy.ini b/mypy.ini index 4a31ea6d3d5cf..ddfa9885e3351 100644 --- a/mypy.ini +++ b/mypy.ini @@ -167,19 +167,6 @@ ignore_errors=True [mypy-pandas.io.stata] ignore_errors=True -<<<<<<< HEAD -[mypy-pandas.tseries.frequencies] -ignore_errors=True - -[mypy-pandas.tseries.holiday] -ignore_errors=True - -[mypy-pandas.tseries.offsets] -======= -[mypy-pandas.plotting._core] ->>>>>>> origin/master -ignore_errors=True - [mypy-pandas.util._doctools] ignore_errors=True