ray.data.expressions.pyarrow_udf#

ray.data.expressions.pyarrow_udf(return_dtype: DataType) Callable[[...], UDFExpr][source]#

Decorator for PyArrow compute functions with automatic format conversion.

This decorator wraps PyArrow compute functions to automatically convert pandas Series and numpy arrays to PyArrow Arrays, ensuring the function works seamlessly regardless of the underlying block format (pandas, arrow, or items).

Used internally by namespace methods (list, str, struct) that wrap PyArrow compute functions.

Parameters:

return_dtype – The data type of the return value

Returns:

A callable that creates UDFExpr instances with automatic conversion

PublicAPI (alpha): This API is in alpha and may change before becoming stable.