[SPARK-35684][INFRA][PYTHON] Bump up mypy version in GitHub Actions

### What changes were proposed in this pull request?

This PR proposes to bump up the mypy version to 0.910 which is the latest.

### Why are the changes needed?

To catch the type hint mistakes better in PySpark.

### Does this PR introduce _any_ user-facing change?

No

### How was this patch tested?

GitHub Actions should test it out.

Closes #33223 from HyukjinKwon/SPARK-35684.

Authored-by: Hyukjin Kwon <gurwls223@apache.org>
Signed-off-by: Hyukjin Kwon <gurwls223@apache.org>
This commit is contained in:
Hyukjin Kwon 2021-07-07 13:26:28 +09:00
parent ca348e50a4
commit 16c195ccfb
4 changed files with 7 additions and 6 deletions

View file

@ -366,9 +366,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.
# TODO(SPARK-35684, SPARK-35683): Bump up the mypy version. This is blocked by
# Index.difference logic issue.
python3.6 -m pip install flake8 pydata_sphinx_theme 'mypy==0.812' numpydoc 'jinja2<3.0.0' 'black==21.5b2'
python3.6 -m pip install flake8 pydata_sphinx_theme 'mypy==0.910' numpydoc 'jinja2<3.0.0' 'black==21.5b2'
- name: Install R linter dependencies and SparkR
run: |
apt-get install -y libcurl4-openssl-dev libgit2-dev libssl-dev libxml2-dev

View file

@ -153,3 +153,6 @@ ignore_missing_imports = True
[mypy-sklearn.*]
ignore_missing_imports = True
[mypy-tabulate.*]
ignore_missing_imports = True

View file

@ -351,7 +351,7 @@ def _create_tuple_for_frame_type(params: Any) -> object:
from pyspark.pandas.typedef import NameTypeHolder
if isinstance(params, zip): # type: ignore
params = [slice(name, tpe) for name, tpe in params]
params = [slice(name, tpe) for name, tpe in params] # type: ignore
if isinstance(params, slice):
params = (params,)
@ -8802,7 +8802,7 @@ defaultdict(<class 'list'>, {'col..., 'col...})]
[scol.alias(index_column) for scol, index_column in zip(scols, index_columns)]
)
else:
psser = ps.Series(list(index))
psser = ps.Series(list(index)) # type: ps.Series
labels = psser._internal.spark_frame.select(psser.spark.column.alias(index_columns[0]))
index_names = self._internal.index_names

View file

@ -2014,7 +2014,7 @@ class Index(IndexOpsMixin):
[isinstance(item, tuple) for item in other]
)
if is_other_list_of_tuples:
other = MultiIndex.from_tuples(other)
other = MultiIndex.from_tuples(other) # type: ignore
elif isinstance(other, Series):
other = Index(other)
else: