diff --git a/environment.yml b/environment.yml index 2c06c321fdbc4..956f3e8dbff74 100644 --- a/environment.yml +++ b/environment.yml @@ -24,7 +24,7 @@ dependencies: - flake8-bugbear=21.3.2 # used by flake8, find likely bugs - flake8-comprehensions=3.1.0 # used by flake8, linting of unnecessary comprehensions - isort>=5.2.1 # check that imports are in the right order - - mypy=0.812 + - mypy=0.910 - pre-commit>=2.9.2 - pycodestyle # used by flake8 - pyupgrade @@ -118,3 +118,7 @@ dependencies: - git+https://github.com/pydata/pydata-sphinx-theme.git@master - numpydoc < 1.2 # 2021-02-09 1.2dev breaking CI - pandas-dev-flaker==0.2.0 + - types-python-dateutil + - types-PyMySQL + - types-pytz + - types-setuptools diff --git a/pandas/core/frame.py b/pandas/core/frame.py index 6cc12ccfba22e..0acbb0c34266f 100644 --- a/pandas/core/frame.py +++ b/pandas/core/frame.py @@ -6190,7 +6190,7 @@ def f(vals) -> tuple[np.ndarray, int]: subset = (subset,) # needed for mypy since can't narrow types using np.iterable - subset = cast(Iterable, subset) + subset = cast(Sequence, subset) # Verify all columns in subset exist in the queried dataframe # Otherwise, raise a KeyError, same as if you try to __getitem__ with a diff --git a/pandas/core/internals/array_manager.py b/pandas/core/internals/array_manager.py index 76967cdc9b52e..be61dd9f35216 100644 --- a/pandas/core/internals/array_manager.py +++ b/pandas/core/internals/array_manager.py @@ -820,9 +820,7 @@ def iset(self, loc: int | slice | np.ndarray, value: ArrayLike): assert isinstance(value, (np.ndarray, ExtensionArray)) assert value.ndim == 1 assert len(value) == len(self._axes[0]) - # error: Invalid index type "Union[int, slice, ndarray]" for - # "List[Union[ndarray, ExtensionArray]]"; expected type "int" - self.arrays[loc] = value # type: ignore[index] + self.arrays[loc] = value return # multiple columns -> convert slice or array to integer indices diff --git a/requirements-dev.txt b/requirements-dev.txt index a0d4c8e02acf6..03c7b7ef41b70 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -12,7 +12,7 @@ flake8==3.9.2 flake8-bugbear==21.3.2 flake8-comprehensions==3.1.0 isort>=5.2.1 -mypy==0.812 +mypy==0.910 pre-commit>=2.9.2 pycodestyle pyupgrade @@ -81,3 +81,7 @@ natsort git+https://github.com/pydata/pydata-sphinx-theme.git@master numpydoc < 1.2 pandas-dev-flaker==0.2.0 +types-python-dateutil +types-PyMySQL +types-pytz +types-setuptools