Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add PyarrowScalarUDF and convert PyScalarUDF to API recommended upstream #907

Open
Michael-J-Ward opened this issue Oct 11, 2024 · 0 comments
Labels
enhancement New feature or request

Comments

@Michael-J-Ward
Copy link
Contributor

Michael-J-Ward commented Oct 11, 2024

Is your feature request related to a problem or challenge? Please describe what you are trying to do.

Up until #906, PyScalarUDF has used datafusion_physical_expr::functions::make_scalar_function which has been deprecated since v36 and is being removed from the public API in v43.

The deprecation warning advised:

Implement your function directly in terms of ColumnarValue or use ScalarUDF instead

datafusion-python users can not currently implement ScalarUDF in that recommended way.

Describe the solution you'd like

  • Change PyScalarUDF to take functions that operate on ColumnarValue, as recommended upstream.
  • Add PyarrowScalarUDF that let's python users continue writing UDF's as they do today.

Describe alternatives you've considered
We could remove the ability to write pyarrow UDF's, forcing users to migrate as directed in the deprecation warning.

Additional context
It may be useful to review how upstream previously converted functions that use ArrayRef to ScalarUDF.

https://github.com/apache/datafusion/blob/8e8bb89a285c6fe6e8186378b7798d3d213f08f7/datafusion/physical-expr/src/functions.rs#L79-L122

@Michael-J-Ward Michael-J-Ward added the enhancement New feature or request label Oct 11, 2024
@Michael-J-Ward Michael-J-Ward changed the title Add PyScalarUDF and convert PyScalarUDF to API recommended upstream Add PyarrowScalarUDF and convert PyScalarUDF to API recommended upstream Oct 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant