dtenedor commented on code in PR #41948:
URL: https://github.com/apache/spark/pull/41948#discussion_r1268552267
##########
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:
I would recommend to return an error in this case if it's easy to do so, in
order to prevent confusion. This would be in addition to the existing error
that @ueshin pointed out that we are already returning:
> It IS checking if the UDTF class has an analyze method and throw an error
if it is not static, and the error message will be like:
```
The UDTF '<name>' is invalid. It does not specify its return type or
implement the required 'analyze' static method. Please specify the return type
or implement the 'analyze' static method in '<name>' and try again.
```
--
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]