Github user icexelloss commented on a diff in the pull request:

    https://github.com/apache/spark/pull/19872#discussion_r161856206
  
    --- Diff: python/pyspark/sql/udf.py ---
    @@ -111,6 +111,10 @@ def returnType(self):
                     and not isinstance(self._returnType_placeholder, 
StructType):
                 raise ValueError("Invalid returnType: returnType must be a 
StructType for "
                                  "pandas_udf with function type GROUP_MAP")
    +        elif self.evalType == PythonEvalType.SQL_PANDAS_GROUP_AGG_UDF \
    +                and isinstance(self._returnType_placeholder, (StructType, 
ArrayType)):
    --- End diff --
    
    Good catch. Yes I added check for `MapType` too.


---

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to