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_r262331202
##########
File path: python/pyspark/sql/udf.py
##########
@@ -133,6 +133,8 @@ def returnType(self):
"UDFs: returnType must be a StructType.")
elif self.evalType == PythonEvalType.SQL_GROUPED_AGG_PANDAS_UDF:
try:
+ if isinstance(self._returnType_placeholder, StructType):
+ raise TypeError
Review comment:
Grouped Agg UDFs don't allow a `StructType` return yet, and before relied on
the call to `to_arrow_type` to raise an error. Since that no longer happens,
need to raise it here.
----------------------------------------------------------------
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]