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



##########
File path: python/pyspark/ml/wrapper.py
##########
@@ -17,57 +17,76 @@
 
 from abc import ABCMeta, abstractmethod
 
+from typing import Any, Generic, Optional, List, Type, TypeVar, TYPE_CHECKING
+
 from pyspark import since
 from pyspark import SparkContext
 from pyspark.sql import DataFrame
 from pyspark.ml import Estimator, Predictor, PredictionModel, Transformer, 
Model
 from pyspark.ml.base import _PredictorParams
-from pyspark.ml.param import Params
-from pyspark.ml.util import _jvm
+from pyspark.ml.param import Param, Params
+from pyspark.ml.util import _jvm  # type: ignore[attr-defined]
 from pyspark.ml.common import inherit_doc, _java2py, _py2java
 
 
+if TYPE_CHECKING:
+    from pyspark.ml._typing import ParamMap
+    from py4j.java_gateway import JavaObject, JavaClass
+
+
+T = TypeVar("T")
+JW = TypeVar("JW", bound="JavaWrapper")
+JM = TypeVar("JM", bound="JavaTransformer")
+JP = TypeVar("JP", bound="JavaParams")

Review comment:
       For runtime generics we need actual types.




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