From 6ae853416b7ea7cbf0d2eb8a4d907119e6f4beab Mon Sep 17 00:00:00 2001 From: Aaditya Panikath Date: Mon, 14 Oct 2019 16:18:51 +0530 Subject: [PATCH 1/4] CLN: pandas-dev#28926 Fix mypy errors in pandas/tests/io/parser/conftest.py --- pandas/tests/io/parser/conftest.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/pandas/tests/io/parser/conftest.py b/pandas/tests/io/parser/conftest.py index 2c347a096006a..373253aa25e39 100644 --- a/pandas/tests/io/parser/conftest.py +++ b/pandas/tests/io/parser/conftest.py @@ -1,4 +1,5 @@ import os +from typing import List, Union import pytest @@ -6,9 +7,9 @@ class BaseParser: - engine = None - low_memory = True - float_precision_choices = [] + engine: Union[str, None] = None + low_memory: bool = True + float_precision_choices: List[Union[str, None]] = [] def update_kwargs(self, kwargs): kwargs = kwargs.copy() @@ -59,11 +60,11 @@ def csv1(csv_dir_path): _py_parsers_only = [_pythonParser] _c_parsers_only = [_cParserHighMemory, _cParserLowMemory] -_all_parsers = _c_parsers_only + _py_parsers_only +_all_parsers = [*_c_parsers_only, *_py_parsers_only] _py_parser_ids = ["python"] _c_parser_ids = ["c_high", "c_low"] -_all_parser_ids = _c_parser_ids + _py_parser_ids +_all_parser_ids = [*_c_parser_ids, *_py_parser_ids] @pytest.fixture(params=_all_parsers, ids=_all_parser_ids) From e0707f9278b0fa98e086eb03bad189cdfa44a107 Mon Sep 17 00:00:00 2001 From: Aaditya Panikath Date: Mon, 14 Oct 2019 18:02:02 +0530 Subject: [PATCH 2/4] CLN: pandas-dev#28926 Fix mypy errors in pandas/tests/io/parser/conftest.py Change for python backward compatibility --- pandas/tests/io/parser/conftest.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pandas/tests/io/parser/conftest.py b/pandas/tests/io/parser/conftest.py index 373253aa25e39..4a33d66547a63 100644 --- a/pandas/tests/io/parser/conftest.py +++ b/pandas/tests/io/parser/conftest.py @@ -7,9 +7,9 @@ class BaseParser: - engine: Union[str, None] = None - low_memory: bool = True - float_precision_choices: List[Union[str, None]] = [] + engine = None # type: Union[str, None] + low_memory = True + float_precision_choices = [] # type: List[Union[str, None]] def update_kwargs(self, kwargs): kwargs = kwargs.copy() From cf7791cf13551b7f295c78511c71dc4a85128fd0 Mon Sep 17 00:00:00 2001 From: Aaditya Panikath Date: Mon, 14 Oct 2019 18:19:51 +0530 Subject: [PATCH 3/4] CLN: Fix mypy errors in pandas/tests/io/parser/conftest.py Modified setup.cfg --- setup.cfg | 3 --- 1 file changed, 3 deletions(-) diff --git a/setup.cfg b/setup.cfg index 64494bf84363e..e3cfd8858cc4a 100644 --- a/setup.cfg +++ b/setup.cfg @@ -205,9 +205,6 @@ ignore_errors=True [mypy-pandas.tests.io.json.test_ujson] ignore_errors=True -[mypy-pandas.tests.io.parser.conftest] -ignore_errors=True - [mypy-pandas.tests.io.test_sql] ignore_errors=True From bbb1fc6ae9c1f1d2ae3d038a2377f0fb998644e8 Mon Sep 17 00:00:00 2001 From: Aaditya Panikath Date: Mon, 14 Oct 2019 22:06:02 +0530 Subject: [PATCH 4/4] CLN: Fix mypy errors in pandas/tests/io/parser/conftest.py Union to Optional --- pandas/tests/io/parser/conftest.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pandas/tests/io/parser/conftest.py b/pandas/tests/io/parser/conftest.py index 4a33d66547a63..183ad500b15f3 100644 --- a/pandas/tests/io/parser/conftest.py +++ b/pandas/tests/io/parser/conftest.py @@ -1,5 +1,5 @@ import os -from typing import List, Union +from typing import List, Optional import pytest @@ -7,9 +7,9 @@ class BaseParser: - engine = None # type: Union[str, None] + engine = None # type: Optional[str] low_memory = True - float_precision_choices = [] # type: List[Union[str, None]] + float_precision_choices = [] # type: List[Optional[str]] def update_kwargs(self, kwargs): kwargs = kwargs.copy()