allisonwang-db commented on code in PR #52122: URL: https://github.com/apache/spark/pull/52122#discussion_r2305823925
########## python/pyspark/sql/functions/builtin.py: ########## @@ -27088,9 +27088,36 @@ def udf( return _create_py_udf(f=f, returnType=returnType, useArrow=useArrow) +@overload +def udtf( + cls: Type, + *, + useArrow: Optional[bool] = None, +) -> "UserDefinedTableFunction": + ... + + +@overload +def udtf( + *, + returnType: Optional[Union[StructType, str]] = None, + useArrow: Optional[bool] = None, +) -> Callable[[Type], "UserDefinedTableFunction"]: + ... + + +@overload +def udtf( + returnType: Union[StructType, str], + *, + useArrow: Optional[bool] = None, +) -> Callable[[Type], "UserDefinedTableFunction"]: + ... + + @_try_remote_functions def udtf( - cls: Optional[Type] = None, + cls: Optional[Union[Type, StructType, str]] = None, *, returnType: Optional[Union[StructType, str]] = None, Review Comment: we also need to change 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. To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org For additional commands, e-mail: reviews-h...@spark.apache.org