Fokko commented on a change in pull request #29122:
URL: https://github.com/apache/spark/pull/29122#discussion_r456688795



##########
File path: python/pyspark/sql/functions.py
##########
@@ -2440,7 +2442,7 @@ def from_json(col, schema, options={}):
 
 
 @since(2.1)
-def to_json(col, options={}):
+def to_json(col, options: Dict = {}):

Review comment:
       Good catch, thanks!

##########
File path: python/pyspark/ml/tuning.py
##########
@@ -500,13 +501,13 @@ class CrossValidatorModel(Model, _CrossValidatorParams, 
MLReadable, MLWritable):
     .. versionadded:: 1.4.0
     """
 
-    def __init__(self, bestModel, avgMetrics=[], subModels=None):
+    def __init__(self, bestModel, avgMetrics: List = None, subModels=None):

Review comment:
       Good question, I don't think these should be optional

##########
File path: python/pyspark/sql/functions.py
##########
@@ -2392,7 +2393,7 @@ def json_tuple(col, *fields):
 
 
 @since(2.1)
-def from_json(col, schema, options={}):
+def from_json(col, schema, options: Dict = None):

Review comment:
       Thanks for pointing out the maillist. Python <3.6 has been dropped in 
the meantime https://github.com/apache/spark/pull/28957.
   
   I'm happy to help with migrating the annotations to the codebase. I still 
believe that it makes much sense to keep them sync with the actual code base. 
Otherwise you need to support multiple versions in your stubs and this also 
requires a lot of effort to keep them in sync.




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

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org

Reply via email to