Skip to content

Commit baec559

Browse files
authored
fix: type scalar UDF returns as Arrow arrays (#1528)
Co-authored-by: BharatDeva <278575558+BharatDeva@users.noreply.github.com>
1 parent 23f9179 commit baec559

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

python/datafusion/user_defined.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
if TYPE_CHECKING:
3434
from _typeshed import CapsuleType as _PyCapsule
3535

36-
_R = TypeVar("_R", bound=pa.DataType)
36+
_R = TypeVar("_R", bound=pa.Array)
3737
from collections.abc import Callable, Sequence
3838

3939

@@ -137,7 +137,7 @@ def __init__(
137137
name: str,
138138
func: Callable[..., _R],
139139
input_fields: list[pa.Field],
140-
return_field: _R,
140+
return_field: pa.Field,
141141
volatility: Volatility | str,
142142
) -> None:
143143
"""Instantiate a scalar user-defined function (UDF).
@@ -311,7 +311,7 @@ def _function(
311311

312312
def _decorator(
313313
input_fields: Sequence[pa.DataType | pa.Field] | pa.DataType | pa.Field,
314-
return_field: _R,
314+
return_field: pa.DataType | pa.Field,
315315
volatility: Volatility | str,
316316
name: str | None = None,
317317
) -> Callable:

0 commit comments

Comments
 (0)