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 2021/12/30 03:53:50 UTC

[GitHub] [spark] dchvn opened a new pull request #35067: [SPARK-37423][PYTHON] Inline type hints for fpm.py in python/pyspark/mllib

dchvn opened a new pull request #35067:
URL: https://github.com/apache/spark/pull/35067


   ### What changes were proposed in this pull request?
   Inline type hints for fpm.py, test.py in python/pyspark/mllib/
   
   
   ### Why are the changes needed?
   We can take advantage of static type checking within the functions by inlining the type hints.
   
   ### Does this PR introduce _any_ user-facing change?
   No
   
   
   ### How was this patch tested?
   Existing tests
   


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


[GitHub] [spark] dchvn commented on a change in pull request #35067: [SPARK-37423][PYTHON] Inline type hints for fpm.py in python/pyspark/mllib

Posted by GitBox <gi...@apache.org>.
dchvn commented on a change in pull request #35067:
URL: https://github.com/apache/spark/pull/35067#discussion_r834896041



##########
File path: python/pyspark/mllib/fpm.py
##########
@@ -17,17 +17,20 @@
 
 import sys
 
-from collections import namedtuple
+from typing import Any, Generic, List, NamedTuple, TypeVar
 
-from pyspark import since
+from pyspark import since, SparkContext
 from pyspark.mllib.common import JavaModelWrapper, callMLlibFunc
 from pyspark.mllib.util import JavaSaveable, JavaLoader, inherit_doc
+from pyspark.rdd import RDD
 
-__all__ = ["FPGrowth", "FPGrowthModel", "PrefixSpan", "PrefixSpanModel"]
+_all__ = ["FPGrowth", "FPGrowthModel", "PrefixSpan", "PrefixSpanModel"]

Review comment:
       Oh, my mistake, updated! Thanks




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


[GitHub] [spark] itholic commented on a change in pull request #35067: [SPARK-37423][PYTHON] Inline type hints for fpm.py in python/pyspark/mllib

Posted by GitBox <gi...@apache.org>.
itholic commented on a change in pull request #35067:
URL: https://github.com/apache/spark/pull/35067#discussion_r833922503



##########
File path: python/pyspark/mllib/fpm.py
##########
@@ -17,17 +17,20 @@
 
 import sys
 
-from collections import namedtuple
+from typing import Any, Generic, List, NamedTuple, TypeVar
 
-from pyspark import since
+from pyspark import since, SparkContext
 from pyspark.mllib.common import JavaModelWrapper, callMLlibFunc
 from pyspark.mllib.util import JavaSaveable, JavaLoader, inherit_doc
+from pyspark.rdd import RDD
 
-__all__ = ["FPGrowth", "FPGrowthModel", "PrefixSpan", "PrefixSpanModel"]
+_all__ = ["FPGrowth", "FPGrowthModel", "PrefixSpan", "PrefixSpanModel"]

Review comment:
       mistake?




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


[GitHub] [spark] dchvn commented on pull request #35067: [SPARK-37423][PYTHON] Inline type hints for fpm.py in python/pyspark/mllib

Posted by GitBox <gi...@apache.org>.
dchvn commented on pull request #35067:
URL: https://github.com/apache/spark/pull/35067#issuecomment-1047593352


   Ping @zero323 , Very glad if you help me resolve this PR! TIA :smiley: 


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


[GitHub] [spark] dchvn commented on pull request #35067: [SPARK-37423][PYTHON] Inline type hints for fpm.py in python/pyspark/mllib

Posted by GitBox <gi...@apache.org>.
dchvn commented on pull request #35067:
URL: https://github.com/apache/spark/pull/35067#issuecomment-1002861576


   CC @zero323 @HyukjinKwon @ueshin, please take a look if you have time. Thanks!


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