You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@spark.apache.org by gu...@apache.org on 2022/11/10 09:26:04 UTC
[spark] branch master updated: [SPARK-41034][CONNECT][PYTHON][FOLLOW-UP] Fix mypy annotations test
This is an automated email from the ASF dual-hosted git repository.
gurwls223 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 c2a8e48e70a [SPARK-41034][CONNECT][PYTHON][FOLLOW-UP] Fix mypy annotations test
c2a8e48e70a is described below
commit c2a8e48e70abfb6bd101c99c5a0f6017151fc85e
Author: Ruifeng Zheng <ru...@apache.org>
AuthorDate: Thu Nov 10 18:25:50 2022 +0900
[SPARK-41034][CONNECT][PYTHON][FOLLOW-UP] Fix mypy annotations test
### What changes were proposed in this pull request?
Fix python mypy
### Why are the changes needed?
https://github.com/apache/spark/pull/38541 breaks the linter
```
starting mypy annotations test...
annotations failed mypy checks:
python/pyspark/sql/connect/plan.py:683: error: Argument 1 to "plan" of "LogicalPlan" has incompatible type "Optional[RemoteSparkSession]"; expected "RemoteSparkSession" [arg-type]
python/pyspark/sql/connect/plan.py:815: error: Argument 1 to "plan" of "LogicalPlan" has incompatible type "Optional[RemoteSparkSession]"; expected "RemoteSparkSession" [arg-type]
Found 2 errors in 1 file (checked 369 source files)
1
```
### Does this PR introduce _any_ user-facing change?
No
### How was this patch tested?
local test
Closes #38597 from zhengruifeng/fix_py_lint_1.
Authored-by: Ruifeng Zheng <ru...@apache.org>
Signed-off-by: Hyukjin Kwon <gu...@apache.org>
---
python/pyspark/sql/connect/plan.py | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/python/pyspark/sql/connect/plan.py b/python/pyspark/sql/connect/plan.py
index db76d84fea1..047c9f2ce0f 100644
--- a/python/pyspark/sql/connect/plan.py
+++ b/python/pyspark/sql/connect/plan.py
@@ -677,7 +677,7 @@ class Repartition(LogicalPlan):
self._num_partitions = num_partitions
self._shuffle = shuffle
- def plan(self, session: Optional["RemoteSparkSession"]) -> proto.Relation:
+ def plan(self, session: "RemoteSparkSession") -> proto.Relation:
rel = proto.Relation()
if self._child is not None:
rel.repartition.input.CopyFrom(self._child.plan(session))
@@ -809,7 +809,7 @@ class StatSummary(LogicalPlan):
super().__init__(child)
self.statistics = statistics
- def plan(self, session: Optional["RemoteSparkSession"]) -> proto.Relation:
+ def plan(self, session: "RemoteSparkSession") -> proto.Relation:
assert self._child is not None
plan = proto.Relation()
plan.summary.input.CopyFrom(self._child.plan(session))
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@spark.apache.org
For additional commands, e-mail: commits-help@spark.apache.org