BryanCutler commented on a change in pull request #22305: 
[SPARK-24561][SQL][Python] User-defined window aggregation functions with 
Pandas UDF (bounded window)
URL: https://github.com/apache/spark/pull/22305#discussion_r241609712
 
 

 ##########
 File path: python/pyspark/worker.py
 ##########
 @@ -238,7 +284,8 @@ def read_udfs(pickleSer, infile, eval_type):
         # In the special case of a single UDF this will return a single result 
rather
         # than a tuple of results; this is the format that the JVM side 
expects.
         for i in range(num_udfs):
-            arg_offsets, udf = read_single_udf(pickleSer, infile, eval_type, 
runner_conf)
+            arg_offsets, udf = read_single_udf(
+                pickleSer, infile, eval_type, runner_conf, udf_index=i)
 
 Review comment:
   Yeah, basically this
   ```
   window_eval_type_str, remaining_type_str = 
runner_conf['pandas_window_bound_types'].split(',', 1)
   runner_conf['pandas_window_bound_types'] = remaining_type_str
   window_eval_type = window_eval_type_str.strip().lower()
   ```
   I'm not crazy about changing the conf inplace, but it wouldn't rely on any 
particular udf indexing then.  Maybe it would make more sense to check the eval 
type before calling `read_single_udf`, process the conf and then send the 
window_eval_type as an optional param to `read_single_udf`?

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on 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


With regards,
Apache Git Services

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

Reply via email to