BryanCutler 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_r261016083
##########
File path: python/pyspark/serializers.py
##########
@@ -295,7 +297,33 @@ 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):
+ raise ValueError("A field of type StructType expects a
pandas.DataFrame, " +
Review comment:
Oh right, thanks!
----------------------------------------------------------------
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:
[email protected]
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]