HyukjinKwon commented on a change in pull request #27406: 
[SPARK-30681][PYSPARK][SQL] Add higher order functions API to PySpark
URL: https://github.com/apache/spark/pull/27406#discussion_r373292073
 
 

 ##########
 File path: python/pyspark/sql/functions.py
 ##########
 @@ -2840,6 +2840,360 @@ def from_csv(col, schema, options={}):
     return Column(jc)
 
 
+def _invoke_higher_order_function(name):
+    """
+    Given name of the expression corresponding to a higher order SQL function,
+    return a function that takes
+
+    - a list of columns
+    - a list of tuples ((*Column) -> Column, Iterable[int])
+      where the second element represent allowed arities
+
+    invokes expression, and wraps result in a Column
+    (first Scala one, then Python).
+    """
+
+    def _(cols, funs):
 
 Review comment:
   @zero323, I know you were trying to logically separate the actual function 
but how about we just avoid having a nested function here? I think it also 
makes sense not to have the nested function here and I personally think it's a 
bit confusing in particular to people not quite used to Python.

----------------------------------------------------------------
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:
[email protected]


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to