Skip to content

Commit 8479e55

Browse files
committed
Update docstring
1 parent 23eb692 commit 8479e55

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
@@ -183,10 +183,14 @@ def udf(*args: Any, **kwargs: Any): # noqa: D417
183183
This class can be used both as either a function or a decorator.
184184
185185
Usage:
186-
- As a function: ``udf(func, input_types, return_type, volatility, name)``.
187-
- As a decorator: ``@udf(input_types, return_type, volatility, name)``.
186+
- As a function: ``udf(func, input_fields, return_field, volatility, name)``.
187+
- As a decorator: ``@udf(input_fields, return_field, volatility, name)``.
188188
When used a decorator, do **not** pass ``func`` explicitly.
189189
190+
In lieu of passing a PyArrow Field, you can pass a DataType for simplicity.
191+
When you do so, it will be assumed that the nullability of the inputs and
192+
output are True and that they have no metadata.
193+
190194
Args:
191195
func (Callable, optional): Only needed when calling as a function.
192196
Skip this argument when using `udf` as a decorator. If you have a Rust
@@ -216,7 +220,7 @@ def double_func(x):
216220
@udf([pa.int32()], pa.int32(), "volatile", "double_it")
217221
def double_udf(x):
218222
return x * 2
219-
"""
223+
""" # noqa: W505 E501
220224

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

0 commit comments

Comments
 (0)