This is an automated email from the ASF dual-hosted git repository. gurwls223 pushed a commit to branch branch-3.3 in repository https://gitbox.apache.org/repos/asf/spark.git
The following commit(s) were added to refs/heads/branch-3.3 by this push: new c9b6b50ff64 [SPARK-39049][PYTHON][CORE][ML] Remove unneeded `pass` c9b6b50ff64 is described below commit c9b6b50ff640b531cc953249311a78f5b75ce349 Author: Bjørn Jørgensen <bjornjorgen...@gmail.com> AuthorDate: Thu Apr 28 09:20:53 2022 +0900 [SPARK-39049][PYTHON][CORE][ML] Remove unneeded `pass` ### What changes were proposed in this pull request? Remove unneeded `pass` ### Why are the changes needed? Class`s Estimator, Transformer and Evaluator are abstract classes. Which has functions. ValueError in def run() has code. By removing `pass` it will be easier to read, understand and reuse code. ### Does this PR introduce _any_ user-facing change? No. ### How was this patch tested? Existing tests passed. Closes #36383 from bjornjorgensen/remove-unneeded-pass. Lead-authored-by: Bjørn Jørgensen <bjornjorgen...@gmail.com> Co-authored-by: bjornjorgensen <bjornjorgen...@gmail.com> Signed-off-by: Hyukjin Kwon <gurwls...@apache.org> (cherry picked from commit 0e875875059c1cbf36de49205a4ce8dbc483d9d1) Signed-off-by: Hyukjin Kwon <gurwls...@apache.org> --- python/pyspark/ml/base.py | 4 ---- python/pyspark/ml/evaluation.py | 2 -- python/pyspark/tests/test_worker.py | 1 - 3 files changed, 7 deletions(-) diff --git a/python/pyspark/ml/base.py b/python/pyspark/ml/base.py index 20540ebbef6..34c3aa9c62c 100644 --- a/python/pyspark/ml/base.py +++ b/python/pyspark/ml/base.py @@ -110,8 +110,6 @@ class Estimator(Params, Generic[M], metaclass=ABCMeta): .. versionadded:: 1.3.0 """ - pass - @abstractmethod def _fit(self, dataset: DataFrame) -> M: """ @@ -220,8 +218,6 @@ class Transformer(Params, metaclass=ABCMeta): .. versionadded:: 1.3.0 """ - pass - @abstractmethod def _transform(self, dataset: DataFrame) -> DataFrame: """ diff --git a/python/pyspark/ml/evaluation.py b/python/pyspark/ml/evaluation.py index ff0e5b91e42..19d123debae 100644 --- a/python/pyspark/ml/evaluation.py +++ b/python/pyspark/ml/evaluation.py @@ -67,8 +67,6 @@ class Evaluator(Params, metaclass=ABCMeta): .. versionadded:: 1.4.0 """ - pass - @abstractmethod def _evaluate(self, dataset: DataFrame) -> float: """ diff --git a/python/pyspark/tests/test_worker.py b/python/pyspark/tests/test_worker.py index 0fdf6adb031..06ada8f81d5 100644 --- a/python/pyspark/tests/test_worker.py +++ b/python/pyspark/tests/test_worker.py @@ -70,7 +70,6 @@ class WorkerTests(ReusedPySparkTestCase): try: daemon_pid, worker_pid = map(int, data) except ValueError: - pass # In case the value is not written yet. cnt += 1 if cnt == 10: --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@spark.apache.org For additional commands, e-mail: commits-h...@spark.apache.org