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_r261296797
##########
File path: python/pyspark/sql/types.py
##########
@@ -1616,6 +1616,12 @@ def to_arrow_type(dt):
if type(dt.elementType) == TimestampType:
raise TypeError("Unsupported type in conversion to Arrow: " +
str(dt))
arrow_type = pa.list_(to_arrow_type(dt.elementType))
+ elif type(dt) == StructType:
+ if any(type(field.dataType) == StructType for field in dt):
+ raise TypeError("Nested StructType not supported in conversion to
Arrow")
Review comment:
Good catch, that should not be supported right now. I added a check and put
that type in a test.
----------------------------------------------------------------
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]