Skip to content

Commit 10751dc

Browse files
HyukjinKwondongjoon-hyun
authored andcommitted
[SPARK-44133][PYTHON] Upgrade MyPy from 0.920 to 0.982
### What changes were proposed in this pull request? This PR upgrade MyPy version from 0.920 to 0.982. ### Why are the changes needed? To detect type related changes better by static analysys. ### Does this PR introduce _any_ user-facing change? No, dev-only. ### How was this patch tested? ```bash ./dev/linter-python ``` Closes #41690 from HyukjinKwon/SPARK-44133. Authored-by: Hyukjin Kwon <[email protected]> Signed-off-by: Dongjoon Hyun <[email protected]>
1 parent bbcc438 commit 10751dc

33 files changed

+235
-230
lines changed

.github/workflows/build_and_test.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -624,7 +624,7 @@ jobs:
624624
# See also https://github.com/sphinx-doc/sphinx/issues/7551.
625625
# Jinja2 3.0.0+ causes error when building with Sphinx.
626626
# See also https://issues.apache.org/jira/browse/SPARK-35375.
627-
python3.9 -m pip install 'flake8==3.9.0' pydata_sphinx_theme 'mypy==0.920' 'pytest==7.1.3' 'pytest-mypy-plugins==1.9.3' numpydoc 'jinja2<3.0.0' 'black==22.6.0'
627+
python3.9 -m pip install 'flake8==3.9.0' pydata_sphinx_theme 'mypy==0.982' 'pytest==7.1.3' 'pytest-mypy-plugins==1.9.3' numpydoc 'jinja2<3.0.0' 'black==22.6.0'
628628
python3.9 -m pip install 'pandas-stubs==1.2.0.53' ipython 'grpcio==1.48.1' 'grpc-stubs==1.24.11' 'googleapis-common-protos-stubs==2.2.0'
629629
- name: Python linter
630630
run: PYTHON_EXECUTABLE=python3.9 ./dev/lint-python

dev/requirements.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ openpyxl
2020
coverage
2121

2222
# Linter
23-
mypy==0.920
23+
mypy==0.982
2424
pytest-mypy-plugins==1.9.3
2525
flake8==3.9.0
2626
# See SPARK-38680.

python/pyspark/ml/base.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -396,7 +396,7 @@ def setPredictionCol(self: P, value: str) -> P:
396396
"""
397397
return self._set(predictionCol=value)
398398

399-
@property # type: ignore[misc]
399+
@property
400400
@abstractmethod
401401
@since("2.1.0")
402402
def numFeatures(self) -> int:

0 commit comments

Comments
 (0)