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/06 12:43:09 UTC

[GitHub] [spark] zero323 commented on a change in pull request #35124: [WIP][SPARK-37398][PYTHON] Inline type hints for python/pyspark/ml/classification.py

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



##########
File path: python/pyspark/ml/classification.py
##########
@@ -134,7 +137,7 @@ class Classifier(Predictor, _ClassifierParams, metaclass=ABCMeta):
     """
 
     @since("3.0.0")
-    def setRawPredictionCol(self, value):
+    def setRawPredictionCol(self, value: str) -> "P":

Review comment:
       All the setter methods in classes intended for inheritance should have bounds on `self` to ensure that specific type is resolved on return, i.e.
   
   ```python
   def setRawPredictionCol(self: "P", value: str) -> "P":
   ```
   
   
   
   




-- 
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