HyukjinKwon commented on code in PR #37117:
URL: https://github.com/apache/spark/pull/37117#discussion_r916368956


##########
python/pyspark/ml/util.py:
##########
@@ -536,10 +536,8 @@ def __get_class(clazz: str) -> Type[RL]:
         """
         parts = clazz.split(".")
         module = ".".join(parts[:-1])
-        m = __import__(module)
-        for comp in parts[1:]:
-            m = getattr(m, comp)
-        return m
+        m = __import__(module, fromlist=[parts[-1])

Review Comment:
   I think it depends on which mypy version we use. cc @Yikun FYI.
   If we can find a way to make all versions of mypy happy, that would be ideal.



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