Skip to content

Commit

Permalink
TYP: update to mypy-0.910 (pandas-dev#42206)
Browse files Browse the repository at this point in the history
  • Loading branch information
simonjayhawkins authored Jun 25, 2021
1 parent 3ce150d commit 90f8be0
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 6 deletions.
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

0 comments on commit 90f8be0

Please sign in to comment.