Skip to content

Commit 1164374

Browse files
committed
refactor: Simplify udwf method signature by removing redundant type hints
1 parent 4c397cf commit 1164374

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

python/datafusion/udf.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
import functools
2323
from abc import ABCMeta, abstractmethod
2424
from enum import Enum
25-
from typing import TYPE_CHECKING, Any, Callable, Optional, TypeVar, Union, overload
25+
from typing import TYPE_CHECKING, Any, Callable, Optional, overload
2626

2727
import pyarrow as pa
2828

@@ -639,7 +639,7 @@ def udwf(
639639
@overload
640640
@staticmethod
641641
def udwf(
642-
windown: Callable[[], WindowEvaluator],
642+
func: Callable[[], WindowEvaluator],
643643
input_type: pa.DataType | list[pa.DataType],
644644
return_type: pa.DataType,
645645
state_type: list[pa.DataType],
@@ -648,9 +648,7 @@ def udwf(
648648
) -> WindowUDF: ...
649649

650650
@staticmethod
651-
def udwf(
652-
*args: Any, **kwargs: Any
653-
) -> Union[WindowUDF, Callable[[Callable[[], WindowEvaluator]], WindowUDF]]:
651+
def udwf(*args: Any, **kwargs: Any): # noqa: D417
654652
"""Create a new User-Defined Window Function (UDWF).
655653
656654
This class can be used both as a **function** and as a **decorator**.

0 commit comments

Comments
 (0)