Skip to content

Commit 42a4df0

Browse files
committed
Update docstring
1 parent f1cf7a1 commit 42a4df0

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

python/datafusion/user_defined.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -184,10 +184,14 @@ def udf(*args: Any, **kwargs: Any): # noqa: D417
184184
This class can be used both as either a function or a decorator.
185185
186186
Usage:
187-
- As a function: ``udf(func, input_types, return_type, volatility, name)``.
188-
- As a decorator: ``@udf(input_types, return_type, volatility, name)``.
187+
- As a function: ``udf(func, input_fields, return_field, volatility, name)``.
188+
- As a decorator: ``@udf(input_fields, return_field, volatility, name)``.
189189
When used a decorator, do **not** pass ``func`` explicitly.
190190
191+
In lieu of passing a PyArrow Field, you can pass a DataType for simplicity.
192+
When you do so, it will be assumed that the nullability of the inputs and
193+
output are True and that they have no metadata.
194+
191195
Args:
192196
func (Callable, optional): Only needed when calling as a function.
193197
Skip this argument when using `udf` as a decorator. If you have a Rust
@@ -217,7 +221,7 @@ def double_func(x):
217221
@udf([pa.int32()], pa.int32(), "volatile", "double_it")
218222
def double_udf(x):
219223
return x * 2
220-
"""
224+
""" # noqa: W505 E501
221225

222226
def _function(
223227
func: Callable[..., _R],

0 commit comments

Comments
 (0)