ueshin commented on code in PR #41948:
URL: https://github.com/apache/spark/pull/41948#discussion_r1268593999


##########
python/pyspark/sql/udtf.py:
##########
@@ -153,6 +175,19 @@ def _validate_udtf_handler(cls: Any) -> None:
             error_class="INVALID_UDTF_NO_EVAL", message_parameters={"name": 
cls.__name__}
         )
 
+    has_analyze_staticmethod = hasattr(cls, "analyze") and isinstance(
+        inspect.getattr_static(cls, "analyze"), staticmethod

Review Comment:
   So now at 
[4e2b6be](https://github.com/apache/spark/pull/41948/commits/4e2b6befbd015fcdad1ddf6ccecd79a630ac7d60),
   - When `returnType` is not provided, the class must have `analyze` static 
method; otherwise raise an error `INVALID_UDTF_RETURN_TYPE`.
   - When `returnType` is provided and also the class has any `analyze` 
attribute, raise an error `INVALID_UDTF_BOTH_RETURN_TYPE_AND_ANALYZE`.



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

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


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

Reply via email to