xinrong-databricks commented on a change in pull request #34671:
URL: https://github.com/apache/spark/pull/34671#discussion_r754555187



##########
File path: python/pyspark/ml/common.py
##########
@@ -53,24 +57,24 @@ def _new_smart_decode(obj):
 
 
 # this will call the ML version of pythonToJava()
-def _to_java_object_rdd(rdd):
+def _to_java_object_rdd(rdd: RDD) -> JavaObject:
     """Return an JavaRDD of Object by unpickling
 
     It will convert each Python object into Java object by Pickle, whenever the
     RDD is serialized in batch or not.
     """
-    rdd = rdd._reserialize(AutoBatchedSerializer(PickleSerializer()))
-    return 
rdd.ctx._jvm.org.apache.spark.ml.python.MLSerDe.pythonToJava(rdd._jrdd, True)
+    rdd = rdd._reserialize(AutoBatchedSerializer(PickleSerializer()))  # type: 
ignore[attr-defined]
+    return 
rdd.ctx._jvm.org.apache.spark.ml.python.MLSerDe.pythonToJava(rdd._jrdd, True)  
# type: ignore[attr-defined]

Review comment:
       I think it is fine to leave `type: ignore[attr-defined]` here. We may 
come back to these after inlining type hints for SparkContext for example.




-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to