This is an automated email from the ASF dual-hosted git repository.
zero323 pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/spark.git
The following commit(s) were added to refs/heads/master by this push:
new 86b9592 [SPARK-37704] Update mypy version to 0.920
86b9592 is described below
commit 86b95927e5cc86fa529de4b35b9e4b76c7bc0ca8
Author: zero323 <[email protected]>
AuthorDate: Tue Dec 21 15:25:07 2021 +0100
[SPARK-37704] Update mypy version to 0.920
### What changes were proposed in this pull request?
This PR updates mypy version in GitHub workflow to 0.920.
Additionally, it fixes minor typing issue not detected by 0.910.
### Why are the changes needed?
To keep annotations up to date with typing tools.
### Does this PR introduce _any_ user-facing change?
No.
### How was this patch tested?
Existing tests.
Closes #34972 from zero323/SPARK-37704.
Authored-by: zero323 <[email protected]>
Signed-off-by: zero323 <[email protected]>
---
.github/workflows/build_and_test.yml | 2 +-
python/pyspark/pandas/indexing.py | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/.github/workflows/build_and_test.yml
b/.github/workflows/build_and_test.yml
index cee0b2a..f625193 100644
--- a/.github/workflows/build_and_test.yml
+++ b/.github/workflows/build_and_test.yml
@@ -477,7 +477,7 @@ jobs:
# See also https://github.com/sphinx-doc/sphinx/issues/7551.
# Jinja2 3.0.0+ causes error when building with Sphinx.
# See also https://issues.apache.org/jira/browse/SPARK-35375.
- python3.9 -m pip install 'flake8==3.9.0' pydata_sphinx_theme
'mypy==0.910' numpydoc 'jinja2<3.0.0' 'black==21.5b2'
+ python3.9 -m pip install 'flake8==3.9.0' pydata_sphinx_theme
'mypy==0.920' numpydoc 'jinja2<3.0.0' 'black==21.5b2'
# TODO Update to PyPI
python3.9 -m pip install
git+https://github.com/typeddjango/pytest-mypy-plugins.git@b0020061f48e85743ee3335bd62a3a608d17c6bd
- name: Install R linter dependencies and SparkR
diff --git a/python/pyspark/pandas/indexing.py
b/python/pyspark/pandas/indexing.py
index e8b7b5d..8e1ef66 100644
--- a/python/pyspark/pandas/indexing.py
+++ b/python/pyspark/pandas/indexing.py
@@ -553,7 +553,7 @@ class LocIndexerLike(IndexerLike, metaclass=ABCMeta):
psdf_or_psser: Union[DataFrame, Series]
if returns_series:
- psdf_or_psser = first_series(psdf)
+ psdf_or_psser = cast(Series, first_series(psdf))
if series_name is not None and series_name != psdf_or_psser.name:
psdf_or_psser = psdf_or_psser.rename(series_name)
else:
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]