2121
2222import datafusion ._internal as df_internal
2323from datafusion .expr import Expr
24- from typing import Callable , TYPE_CHECKING , TypeVar , Type
24+ from typing import Callable , TYPE_CHECKING , TypeVar
2525from abc import ABCMeta , abstractmethod
2626from typing import List
2727from enum import Enum
@@ -412,7 +412,7 @@ class WindowUDF:
412412 def __init__ (
413413 self ,
414414 name : str | None ,
415- func : Type [ WindowEvaluator ] ,
415+ func : WindowEvaluator ,
416416 input_type : pyarrow .DataType ,
417417 return_type : pyarrow .DataType ,
418418 volatility : Volatility | str ,
@@ -437,7 +437,7 @@ def __call__(self, *args: Expr) -> Expr:
437437
438438 @staticmethod
439439 def udwf (
440- func : Type [ WindowEvaluator ] ,
440+ func : WindowEvaluator ,
441441 input_type : pyarrow .DataType ,
442442 return_type : pyarrow .DataType ,
443443 volatility : Volatility | str ,
@@ -455,12 +455,12 @@ def udwf(
455455 Returns:
456456 A user defined window function.
457457 """
458- if not issubclass (func , WindowEvaluator ):
458+ if not isinstance (func , WindowEvaluator ):
459459 raise TypeError (
460460 "`func` must implement the abstract base class WindowEvaluator"
461461 )
462462 if name is None :
463- name = func .__qualname__ .lower ()
463+ name = func .__class__ . __qualname__ .lower ()
464464 return WindowUDF (
465465 name = name ,
466466 func = func ,
0 commit comments