This is an automated email from the ASF dual-hosted git repository.

srowen 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 7ac27514f64 [SPARK-39113][CORE][MLLIB][PYTHON] Rename `self` to `cls`
7ac27514f64 is described below

commit 7ac27514f64a42d5e934332065c03c65d0d657cd
Author: bjornjorgensen <bjornjorgen...@gmail.com>
AuthorDate: Sun May 8 08:07:19 2022 -0500

    [SPARK-39113][CORE][MLLIB][PYTHON] Rename `self` to `cls`
    
    ### What changes were proposed in this pull request?
    Rename `self` to `cls`
    
    ### Why are the changes needed?
    Function def train(self....) is decorated as a classmethod
    
    ### Does this PR introduce _any_ user-facing change?
    No.
    
    ### How was this patch tested?
    Pass existed tests.
    
    Closes #36465 from bjornjorgensen/rename-self-to-cls.
    
    Authored-by: bjornjorgensen <bjornjorgen...@gmail.com>
    Signed-off-by: Sean Owen <sro...@gmail.com>
---
 python/pyspark/mllib/clustering.py | 2 +-
 python/pyspark/testing/sqlutils.py | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/python/pyspark/mllib/clustering.py 
b/python/pyspark/mllib/clustering.py
index fd33887fd9e..bf8073c2a2e 100644
--- a/python/pyspark/mllib/clustering.py
+++ b/python/pyspark/mllib/clustering.py
@@ -176,7 +176,7 @@ class BisectingKMeans:
 
     @classmethod
     def train(
-        self,
+        cls,
         rdd: RDD["VectorLike"],
         k: int = 4,
         maxIterations: int = 20,
diff --git a/python/pyspark/testing/sqlutils.py 
b/python/pyspark/testing/sqlutils.py
index 3eb58ffee87..92fcd08091c 100644
--- a/python/pyspark/testing/sqlutils.py
+++ b/python/pyspark/testing/sqlutils.py
@@ -79,7 +79,7 @@ class ExamplePointUDT(UserDefinedType):
     """
 
     @classmethod
-    def sqlType(self):
+    def sqlType(cls):
         return ArrayType(DoubleType(), False)
 
     @classmethod
@@ -124,7 +124,7 @@ class PythonOnlyUDT(UserDefinedType):
     """
 
     @classmethod
-    def sqlType(self):
+    def sqlType(cls):
         return ArrayType(DoubleType(), False)
 
     @classmethod


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@spark.apache.org
For additional commands, e-mail: commits-h...@spark.apache.org

Reply via email to