Skip to content

TYP: update to mypy-0.910 #42206

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jun 25, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
2 changes: 1 addition & 1 deletion pandas/core/frame.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 1 addition & 3 deletions pandas/core/internals/array_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 5 additions & 1 deletion requirements-dev.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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