You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by GitBox <gi...@apache.org> on 2022/02/19 18:29:29 UTC

[GitHub] [spark] zero323 commented on a change in pull request #35578: [SPARK-37402][PYTHON][MLLIB] Inline typehints for pyspark.mllib.clustering

zero323 commented on a change in pull request #35578:
URL: https://github.com/apache/spark/pull/35578#discussion_r810523083



##########
File path: python/pyspark/mllib/clustering.py
##########
@@ -867,18 +940,20 @@ class StreamingKMeansModel(KMeansModel):
     1
     """
 
-    def __init__(self, clusterCenters, clusterWeights):
+    def __init__(self, clusterCenters: List["VectorLike"], clusterWeights: "VectorLike"):
         super(StreamingKMeansModel, self).__init__(centers=clusterCenters)
-        self._clusterWeights = list(clusterWeights)
+        self._clusterWeights = list(clusterWeights)  # type: ignore[arg-type]

Review comment:
       Ideally, this and similar ignores wouldn't be needed, but we have `List[VectorLike]`, `np.ndarray` and `List[np.ndarray]` in different places (including test outputs) and I am concerned that making things consistent can break some 3rd party code. 




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org