1919
2020from __future__ import annotations
2121
22- from ast import Call
2322import functools
2423from abc import ABCMeta , abstractmethod
2524from enum import Enum
@@ -647,15 +646,17 @@ def udwf(
647646 ) -> WindowUDF : ...
648647
649648 @staticmethod
650- def udwf (* args : Any , ** kwargs : Any ): # noqa: D417
649+ def udwf (* args : Any , ** kwargs : Any ): # noqa: D417, C901
651650 """Create a new User-Defined Window Function (UDWF).
652651
653652 This class can be used both as a **function** and as a **decorator**.
654653
655654 Usage:
656- - **As a function**: Call `udwf(func, input_types, return_type, volatility, name)`.
657- - **As a decorator**: Use `@udwf(input_types, return_type, volatility, name)`.
658- When using `udwf` as a decorator, **do not pass `func` explicitly**.
655+ - **As a function**: Call `udwf(func, input_types, return_type, volatility,
656+ name)`.
657+ - **As a decorator**: Use `@udwf(input_types, return_type, volatility,
658+ name)`. When using `udwf` as a decorator, **do not pass `func`
659+ explicitly**.
659660
660661 **Function example:**
661662 ```
@@ -665,7 +666,8 @@ class BiasedNumbers(WindowEvaluator):
665666 def __init__(self, start: int = 0) -> None:
666667 self.start = start
667668
668- def evaluate_all(self, values: list[pa.Array], num_rows: int) -> pa.Array:
669+ def evaluate_all(self, values: list[pa.Array],
670+ num_rows: int) -> pa.Array:
669671 return pa.array([self.start + i for i in range(num_rows)])
670672
671673 def bias_10() -> BiasedNumbers:
@@ -685,8 +687,8 @@ def biased_numbers() -> BiasedNumbers:
685687 ```
686688
687689 Args:
688- func: **Only needed when calling as a function. Skip this argument when using
689- `udwf` as a decorator.**
690+ func: **Only needed when calling as a function. Skip this argument when
691+ using `udwf` as a decorator.**
690692 input_types: The data types of the arguments.
691693 return_type: The data type of the return value.
692694 volatility: See :py:class:`Volatility` for allowed values.
0 commit comments