HyukjinKwon commented on a change in pull request #23900: [SPARK-23836][PYTHON] 
Add support for StructType return in Scalar Pandas UDF
URL: https://github.com/apache/spark/pull/23900#discussion_r268465039
 
 

 ##########
 File path: python/pyspark/serializers.py
 ##########
 @@ -295,7 +297,34 @@ def create_array(s, t):
             raise RuntimeError(error_msg % (s.dtype, t), e)
         return array
 
-    arrs = [create_array(s, t) for s, t in series]
+    arrs = []
+    for s, t in series:
+        if t is not None and pa.types.is_struct(t):
+            if not isinstance(s, pd.DataFrame):
 
 Review comment:
   Looks good @BryanCutler, and cc @ueshin FYI. Just out of curiosity, WDYT 
about putting those PySpark specific conversion logics into somewhere together, 
of course, in a separate PR and JIRA? Looks it's getting difficult to read (to 
me .. )

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