zero323 commented on a change in pull request #34671:
URL: https://github.com/apache/spark/pull/34671#discussion_r754637469
##########
File path: python/pyspark/ml/common.py
##########
@@ -15,11 +15,15 @@
# limitations under the License.
#
+from typing import Any, Callable
+from pyspark.ml._typing import C, JavaObjectOrPickleDump
Review comment:
This import should happen in TYPE_CHECKING block
```python
from typing import TYPE_CHECKING
if TYPE_CHECKING:
from pyspark.ml._typing import C, JavaObjectOrPickleDump
```
Consequently, `JavaObjectOrPickleDump` and `C` have to be quoted when used
(`"JavaObjectOrPickleDump"`), i.e.
```python
def _java2py(sc: SparkContext, r: "JavaObjectOrPickleDump", encoding: str =
"bytes") -> Any: ...
```
That's because objects in stubs have no runtime equivalents.
--
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]