@@ -747,6 +747,7 @@ def wrapper(*args: Any, **kwargs: Any) -> Expr:
747
747
748
748
return decorator
749
749
750
+
750
751
class TableFunction :
751
752
"""Class for performing user-defined table functions (UDTF).
752
753
@@ -755,9 +756,9 @@ class TableFunction:
755
756
"""
756
757
757
758
def __init__ (
758
- self ,
759
- name : str ,
760
- func : Callable [[], any ],
759
+ self ,
760
+ name : str ,
761
+ func : Callable [[], any ],
761
762
) -> None :
762
763
"""Instantiate a user-defined table function (UDTF).
763
764
@@ -774,14 +775,14 @@ def __call__(self, *args: Expr) -> Any:
774
775
@overload
775
776
@staticmethod
776
777
def udtf (
777
- name : str ,
778
+ name : str ,
778
779
) -> Callable [..., Any ]: ...
779
780
780
781
@overload
781
782
@staticmethod
782
783
def udtf (
783
- func : Callable [[], Any ],
784
- name : str ,
784
+ func : Callable [[], Any ],
785
+ name : str ,
785
786
) -> TableFunction : ...
786
787
787
788
@staticmethod
@@ -798,8 +799,8 @@ def udtf(*args: Any, **kwargs: Any):
798
799
799
800
@staticmethod
800
801
def _create_table_udf (
801
- func : Callable [..., Any ],
802
- name : str ,
802
+ func : Callable [..., Any ],
803
+ name : str ,
803
804
) -> TableFunction :
804
805
"""Create a TableFunction instance from function arguments."""
805
806
if not callable (func ):
@@ -810,7 +811,7 @@ def _create_table_udf(
810
811
811
812
@staticmethod
812
813
def _create_table_udf_decorator (
813
- name : Optional [str ] = None ,
814
+ name : Optional [str ] = None ,
814
815
) -> Callable [[Callable [[], WindowEvaluator ]], Callable [..., Expr ]]:
815
816
"""Create a decorator for a WindowUDF."""
816
817
0 commit comments