8000 refactor: Update udwf calls in WindowUDF to use BiasedNumbers directly · kosiew/datafusion-python@ae62383 · GitHub
[go: up one dir, main page]

Skip to content

Commit ae62383

Browse files
committed
refactor: Update udwf calls in WindowUDF to use BiasedNumbers directly
- Changed udwf1 to use BiasedNumbers instead of bias_10. - Added udwf2 to call udwf with bias_10. - Introduced udwf3 to demonstrate a lambda function returning BiasedNumbers(20).
1 parent 86cc70e commit ae62383

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

python/datafusion/udf.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -653,7 +653,10 @@ def evaluate_all(self, values: list[pa.Array], num_rows: int) -> pa.Array:
653653
def bias_10() -> BiasedNumbers:
654654
return BiasedNumbers(10)
655655
656-
udwf1 = udwf(bias_10, pa.int64(), pa.int64(), "immutable")
656+
udwf1 = udwf(BiasedNumbers, pa.int64(), pa.int64(), "immutable")
657+
udwf2 = udwf(bias_10, pa.int64(), pa.int64(), "immutable")
658+
udwf3 = udwf(lambda: BiasedNumbers(20), pa.int64(), pa.int64(), "immutable")
659+
657660
```
658661
659662
**Decorator example:**

0 commit comments

Comments
 (0)
0