Skip to content

Commit d919ff4

Browse files
simonjayhawkinsJulianWgs
authored andcommitted
TYP: update to mypy-0.910 (pandas-dev#42206)
1 parent dd3d559 commit d919ff4

File tree

4 files changed

+12
-6
lines changed

4 files changed

+12
-6
lines changed

environment.yml

+5-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ dependencies:
2424
- flake8-bugbear=21.3.2 # used by flake8, find likely bugs
2525
- flake8-comprehensions=3.1.0 # used by flake8, linting of unnecessary comprehensions
2626
- isort>=5.2.1 # check that imports are in the right order
27-
- mypy=0.812
27+
- mypy=0.910
2828
- pre-commit>=2.9.2
2929
- pycodestyle # used by flake8
3030
- pyupgrade
@@ -118,3 +118,7 @@ dependencies:
118118
- git+https://github.com/pydata/pydata-sphinx-theme.git@master
119119
- numpydoc < 1.2 # 2021-02-09 1.2dev breaking CI
120120
- pandas-dev-flaker==0.2.0
121+
- types-python-dateutil
122+
- types-PyMySQL
123+
- types-pytz
124+
- types-setuptools

pandas/core/frame.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -6190,7 +6190,7 @@ def f(vals) -> tuple[np.ndarray, int]:
61906190
subset = (subset,)
61916191

61926192
# needed for mypy since can't narrow types using np.iterable
6193-
subset = cast(Iterable, subset)
6193+
subset = cast(Sequence, subset)
61946194

61956195
# Verify all columns in subset exist in the queried dataframe
61966196
# Otherwise, raise a KeyError, same as if you try to __getitem__ with a

pandas/core/internals/array_manager.py

+1-3
Original file line numberDiff line numberDiff line change
@@ -820,9 +820,7 @@ def iset(self, loc: int | slice | np.ndarray, value: ArrayLike):
820820
assert isinstance(value, (np.ndarray, ExtensionArray))
821821
assert value.ndim == 1
822822
assert len(value) == len(self._axes[0])
823-
# error: Invalid index type "Union[int, slice, ndarray]" for
824-
# "List[Union[ndarray, ExtensionArray]]"; expected type "int"
825-
self.arrays[loc] = value # type: ignore[index]
823+
self.arrays[loc] = value
826824
return
827825

828826
# multiple columns -> convert slice or array to integer indices

requirements-dev.txt

+5-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ flake8==3.9.2
1212
flake8-bugbear==21.3.2
1313
flake8-comprehensions==3.1.0
1414
isort>=5.2.1
15-
mypy==0.812
15+
mypy==0.910
1616
pre-commit>=2.9.2
1717
pycodestyle
1818
pyupgrade
@@ -81,3 +81,7 @@ natsort
8181
git+https://github.com/pydata/pydata-sphinx-theme.git@master
8282
numpydoc < 1.2
8383
pandas-dev-flaker==0.2.0
84+
types-python-dateutil
85+
types-PyMySQL
86+
types-pytz
87+
types-setuptools

0 commit comments

Comments
 (0)