From e77585c44917dc9a12fc4d6d0af82c08d1e1cdaf Mon Sep 17 00:00:00 2001 From: Scott Cole Date: Sun, 13 Oct 2019 14:49:28 -0700 Subject: [PATCH 01/13] add None as optional type with IntervalIndex --- pandas/tests/indexes/interval/test_base.py | 3 ++- setup.cfg | 3 --- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/pandas/tests/indexes/interval/test_base.py b/pandas/tests/indexes/interval/test_base.py index 339bdaf79c690..7274cc780541e 100644 --- a/pandas/tests/indexes/interval/test_base.py +++ b/pandas/tests/indexes/interval/test_base.py @@ -1,5 +1,6 @@ import numpy as np import pytest +from typing import Optional, Type from pandas import IntervalIndex, Series, date_range from pandas.tests.indexes.common import Base @@ -12,7 +13,7 @@ class TestBase(Base): in test_interval.py or the specific test file (e.g. test_astype.py) """ - _holder = IntervalIndex + _holder = IntervalIndex # type: Optional[Type[IntervalIndex]] @pytest.fixture def indices(self): diff --git a/setup.cfg b/setup.cfg index 149af6c283d05..028bd6178760c 100644 --- a/setup.cfg +++ b/setup.cfg @@ -172,9 +172,6 @@ ignore_errors=True [mypy-pandas.tests.indexes.datetimes.test_datetimelike] ignore_errors=True -[mypy-pandas.tests.indexes.interval.test_base] -ignore_errors=True - [mypy-pandas.tests.indexes.interval.test_interval_tree] ignore_errors=True From 311fff214cda6bb2f62be0d1cd3862b517037301 Mon Sep 17 00:00:00 2001 From: Scott Cole Date: Sun, 13 Oct 2019 17:49:23 -0700 Subject: [PATCH 02/13] add typing to the class Base --- pandas/tests/indexes/common.py | 3 ++- pandas/tests/indexes/interval/test_base.py | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/pandas/tests/indexes/common.py b/pandas/tests/indexes/common.py index b657d8d16df81..c781cb46137dc 100644 --- a/pandas/tests/indexes/common.py +++ b/pandas/tests/indexes/common.py @@ -2,6 +2,7 @@ import numpy as np import pytest +from typing import Optional, Type from pandas._libs.tslib import iNaT @@ -30,7 +31,7 @@ class Base: """ base class for index sub-class tests """ - _holder = None + _holder = None # type: Optional[Type[IntervalIndex]] _compat_props = ["shape", "ndim", "size", "nbytes"] def test_pickle_compat_construction(self): diff --git a/pandas/tests/indexes/interval/test_base.py b/pandas/tests/indexes/interval/test_base.py index 7274cc780541e..3a83493ace063 100644 --- a/pandas/tests/indexes/interval/test_base.py +++ b/pandas/tests/indexes/interval/test_base.py @@ -13,7 +13,7 @@ class TestBase(Base): in test_interval.py or the specific test file (e.g. test_astype.py) """ - _holder = IntervalIndex # type: Optional[Type[IntervalIndex]] + _holder = IntervalIndex # type: Optional[Type[IntervalIndex]] @pytest.fixture def indices(self): From 70ef1375282428171367cb0ceecaac0aae5e18ed Mon Sep 17 00:00:00 2001 From: Scott Cole Date: Sun, 13 Oct 2019 19:30:36 -0700 Subject: [PATCH 03/13] remove changes to test_base --- pandas/tests/indexes/interval/test_base.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/pandas/tests/indexes/interval/test_base.py b/pandas/tests/indexes/interval/test_base.py index 3a83493ace063..339bdaf79c690 100644 --- a/pandas/tests/indexes/interval/test_base.py +++ b/pandas/tests/indexes/interval/test_base.py @@ -1,6 +1,5 @@ import numpy as np import pytest -from typing import Optional, Type from pandas import IntervalIndex, Series, date_range from pandas.tests.indexes.common import Base @@ -13,7 +12,7 @@ class TestBase(Base): in test_interval.py or the specific test file (e.g. test_astype.py) """ - _holder = IntervalIndex # type: Optional[Type[IntervalIndex]] + _holder = IntervalIndex @pytest.fixture def indices(self): From 7bfad539402c79d06582c92c0ca6c440c0071f74 Mon Sep 17 00:00:00 2001 From: Scott Cole Date: Sun, 13 Oct 2019 19:34:55 -0700 Subject: [PATCH 04/13] change allowed Base type to Index to fix mypy errors in other test files --- pandas/tests/indexes/common.py | 2 +- setup.cfg | 12 ------------ 2 files changed, 1 insertion(+), 13 deletions(-) diff --git a/pandas/tests/indexes/common.py b/pandas/tests/indexes/common.py index c781cb46137dc..2933e302a4387 100644 --- a/pandas/tests/indexes/common.py +++ b/pandas/tests/indexes/common.py @@ -31,7 +31,7 @@ class Base: """ base class for index sub-class tests """ - _holder = None # type: Optional[Type[IntervalIndex]] + _holder = None # type: Optional[Type[Index]] _compat_props = ["shape", "ndim", "size", "nbytes"] def test_pickle_compat_construction(self): diff --git a/setup.cfg b/setup.cfg index 028bd6178760c..37f7a92b66bfb 100644 --- a/setup.cfg +++ b/setup.cfg @@ -169,15 +169,9 @@ ignore_errors=True [mypy-pandas.tests.frame.test_convert_to] ignore_errors=True -[mypy-pandas.tests.indexes.datetimes.test_datetimelike] -ignore_errors=True - [mypy-pandas.tests.indexes.interval.test_interval_tree] ignore_errors=True -[mypy-pandas.tests.indexes.period.test_period] -ignore_errors=True - [mypy-pandas.tests.indexes.test_base] ignore_errors=True @@ -187,12 +181,6 @@ ignore_errors=True [mypy-pandas.tests.indexes.test_numeric] ignore_errors=True -[mypy-pandas.tests.indexes.test_range] -ignore_errors=True - -[mypy-pandas.tests.indexes.timedeltas.test_timedelta] -ignore_errors=True - [mypy-pandas.tests.indexing.test_coercion] ignore_errors=True From f8a21a24ebad7318484618d3bfc0bd8faeae8023 Mon Sep 17 00:00:00 2001 From: Scott Cole Date: Tue, 15 Oct 2019 20:12:29 -0700 Subject: [PATCH 05/13] rearrange imports --- pandas/tests/indexes/common.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pandas/tests/indexes/common.py b/pandas/tests/indexes/common.py index 2933e302a4387..1ac6370860ba6 100644 --- a/pandas/tests/indexes/common.py +++ b/pandas/tests/indexes/common.py @@ -1,8 +1,8 @@ import gc +from typing import Optional, Type import numpy as np import pytest -from typing import Optional, Type from pandas._libs.tslib import iNaT From ab73ccf1f5ec6259351bba5a2955126eb8750f62 Mon Sep 17 00:00:00 2001 From: Scott Cole Date: Tue, 15 Oct 2019 20:20:28 -0700 Subject: [PATCH 06/13] stop ignoring errors in test_numeric and test_category --- setup.cfg | 6 ------ 1 file changed, 6 deletions(-) diff --git a/setup.cfg b/setup.cfg index 37f7a92b66bfb..8567f9e55b63e 100644 --- a/setup.cfg +++ b/setup.cfg @@ -175,12 +175,6 @@ ignore_errors=True [mypy-pandas.tests.indexes.test_base] ignore_errors=True -[mypy-pandas.tests.indexes.test_category] -ignore_errors=True - -[mypy-pandas.tests.indexes.test_numeric] -ignore_errors=True - [mypy-pandas.tests.indexing.test_coercion] ignore_errors=True From c483f77536dfdc1a0bb1bcb25f7182f177b2183d Mon Sep 17 00:00:00 2001 From: Scott Cole Date: Sun, 13 Oct 2019 14:49:28 -0700 Subject: [PATCH 07/13] add None as optional type with IntervalIndex --- pandas/tests/indexes/interval/test_base.py | 3 ++- setup.cfg | 3 --- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/pandas/tests/indexes/interval/test_base.py b/pandas/tests/indexes/interval/test_base.py index 339bdaf79c690..7274cc780541e 100644 --- a/pandas/tests/indexes/interval/test_base.py +++ b/pandas/tests/indexes/interval/test_base.py @@ -1,5 +1,6 @@ import numpy as np import pytest +from typing import Optional, Type from pandas import IntervalIndex, Series, date_range from pandas.tests.indexes.common import Base @@ -12,7 +13,7 @@ class TestBase(Base): in test_interval.py or the specific test file (e.g. test_astype.py) """ - _holder = IntervalIndex + _holder = IntervalIndex # type: Optional[Type[IntervalIndex]] @pytest.fixture def indices(self): diff --git a/setup.cfg b/setup.cfg index 462e79dae1039..a8bf087971c60 100644 --- a/setup.cfg +++ b/setup.cfg @@ -172,9 +172,6 @@ ignore_errors=True [mypy-pandas.tests.indexes.datetimes.test_datetimelike] ignore_errors=True -[mypy-pandas.tests.indexes.interval.test_base] -ignore_errors=True - [mypy-pandas.tests.indexes.interval.test_interval_tree] ignore_errors=True From 46449d2803b326ce7053c2fafbe9dd1b332ae3cd Mon Sep 17 00:00:00 2001 From: Scott Cole Date: Sun, 13 Oct 2019 17:49:23 -0700 Subject: [PATCH 08/13] add typing to the class Base --- pandas/tests/indexes/common.py | 3 ++- pandas/tests/indexes/interval/test_base.py | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/pandas/tests/indexes/common.py b/pandas/tests/indexes/common.py index b657d8d16df81..c781cb46137dc 100644 --- a/pandas/tests/indexes/common.py +++ b/pandas/tests/indexes/common.py @@ -2,6 +2,7 @@ import numpy as np import pytest +from typing import Optional, Type from pandas._libs.tslib import iNaT @@ -30,7 +31,7 @@ class Base: """ base class for index sub-class tests """ - _holder = None + _holder = None # type: Optional[Type[IntervalIndex]] _compat_props = ["shape", "ndim", "size", "nbytes"] def test_pickle_compat_construction(self): diff --git a/pandas/tests/indexes/interval/test_base.py b/pandas/tests/indexes/interval/test_base.py index 7274cc780541e..3a83493ace063 100644 --- a/pandas/tests/indexes/interval/test_base.py +++ b/pandas/tests/indexes/interval/test_base.py @@ -13,7 +13,7 @@ class TestBase(Base): in test_interval.py or the specific test file (e.g. test_astype.py) """ - _holder = IntervalIndex # type: Optional[Type[IntervalIndex]] + _holder = IntervalIndex # type: Optional[Type[IntervalIndex]] @pytest.fixture def indices(self): From 20d59c218d9a2884af87e1d5f053bddbba8230c5 Mon Sep 17 00:00:00 2001 From: Scott Cole Date: Sun, 13 Oct 2019 19:30:36 -0700 Subject: [PATCH 09/13] remove changes to test_base --- pandas/tests/indexes/interval/test_base.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/pandas/tests/indexes/interval/test_base.py b/pandas/tests/indexes/interval/test_base.py index 3a83493ace063..339bdaf79c690 100644 --- a/pandas/tests/indexes/interval/test_base.py +++ b/pandas/tests/indexes/interval/test_base.py @@ -1,6 +1,5 @@ import numpy as np import pytest -from typing import Optional, Type from pandas import IntervalIndex, Series, date_range from pandas.tests.indexes.common import Base @@ -13,7 +12,7 @@ class TestBase(Base): in test_interval.py or the specific test file (e.g. test_astype.py) """ - _holder = IntervalIndex # type: Optional[Type[IntervalIndex]] + _holder = IntervalIndex @pytest.fixture def indices(self): From 3f2d8e1b9ca38878eaf8048a86ec65fe58251615 Mon Sep 17 00:00:00 2001 From: Scott Cole Date: Sun, 13 Oct 2019 19:34:55 -0700 Subject: [PATCH 10/13] change allowed Base type to Index to fix mypy errors in other test files --- pandas/tests/indexes/common.py | 2 +- setup.cfg | 12 ------------ 2 files changed, 1 insertion(+), 13 deletions(-) diff --git a/pandas/tests/indexes/common.py b/pandas/tests/indexes/common.py index c781cb46137dc..2933e302a4387 100644 --- a/pandas/tests/indexes/common.py +++ b/pandas/tests/indexes/common.py @@ -31,7 +31,7 @@ class Base: """ base class for index sub-class tests """ - _holder = None # type: Optional[Type[IntervalIndex]] + _holder = None # type: Optional[Type[Index]] _compat_props = ["shape", "ndim", "size", "nbytes"] def test_pickle_compat_construction(self): diff --git a/setup.cfg b/setup.cfg index a8bf087971c60..747e99c59907b 100644 --- a/setup.cfg +++ b/setup.cfg @@ -169,15 +169,9 @@ ignore_errors=True [mypy-pandas.tests.frame.test_convert_to] ignore_errors=True -[mypy-pandas.tests.indexes.datetimes.test_datetimelike] -ignore_errors=True - [mypy-pandas.tests.indexes.interval.test_interval_tree] ignore_errors=True -[mypy-pandas.tests.indexes.period.test_period] -ignore_errors=True - [mypy-pandas.tests.indexes.test_base] ignore_errors=True @@ -187,12 +181,6 @@ ignore_errors=True [mypy-pandas.tests.indexes.test_numeric] ignore_errors=True -[mypy-pandas.tests.indexes.test_range] -ignore_errors=True - -[mypy-pandas.tests.indexes.timedeltas.test_timedelta] -ignore_errors=True - [mypy-pandas.tests.indexing.test_coercion] ignore_errors=True From 7460018423c15b81323ff34efafa3daca70c2dce Mon Sep 17 00:00:00 2001 From: Scott Cole Date: Tue, 15 Oct 2019 20:12:29 -0700 Subject: [PATCH 11/13] rearrange imports --- pandas/tests/indexes/common.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pandas/tests/indexes/common.py b/pandas/tests/indexes/common.py index 2933e302a4387..1ac6370860ba6 100644 --- a/pandas/tests/indexes/common.py +++ b/pandas/tests/indexes/common.py @@ -1,8 +1,8 @@ import gc +from typing import Optional, Type import numpy as np import pytest -from typing import Optional, Type from pandas._libs.tslib import iNaT From 77ebda7d00c1fde9393de7e7f376d2108340c944 Mon Sep 17 00:00:00 2001 From: Scott Cole Date: Tue, 15 Oct 2019 20:20:28 -0700 Subject: [PATCH 12/13] stop ignoring errors in test_numeric and test_category --- setup.cfg | 6 ------ 1 file changed, 6 deletions(-) diff --git a/setup.cfg b/setup.cfg index 747e99c59907b..d9460faa69714 100644 --- a/setup.cfg +++ b/setup.cfg @@ -175,12 +175,6 @@ ignore_errors=True [mypy-pandas.tests.indexes.test_base] ignore_errors=True -[mypy-pandas.tests.indexes.test_category] -ignore_errors=True - -[mypy-pandas.tests.indexes.test_numeric] -ignore_errors=True - [mypy-pandas.tests.indexing.test_coercion] ignore_errors=True From 01133ab180e7d2f3949d9eda6ab3c6743f0b2457 Mon Sep 17 00:00:00 2001 From: Scott Cole Date: Mon, 28 Oct 2019 08:04:18 -0700 Subject: [PATCH 13/13] remove test_coercion --- setup.cfg | 3 --- 1 file changed, 3 deletions(-) diff --git a/setup.cfg b/setup.cfg index d9c1173349b4a..1853a5adf73aa 100644 --- a/setup.cfg +++ b/setup.cfg @@ -172,9 +172,6 @@ ignore_errors=True [mypy-pandas.tests.indexes.test_base] ignore_errors=True -[mypy-pandas.tests.indexing.test_coercion] -ignore_errors=True - [mypy-pandas.tests.indexing.test_loc] ignore_errors=True