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/07/08 00:27:45 UTC

[GitHub] [spark] HyukjinKwon commented on a diff in pull request #37117: [WIP][HOTFIX][python] Try to fix the mypy annotation tests

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