Skip to content

Separable Python and Rust components #1193

@awhyte

Description

@awhyte

Is your feature request related to a problem or challenge? Please describe what you are trying to do.
I maintain a Rust library that uses Datafusion internally for certain calculations. The remainder of this library can be operated from Python via pyo3.

In order to control the behvariour of some of the internal Datafusion calculations, I would like to be able to pass datafusion-python Python objects like [Py]Expr and [Py]SortExpr into Rust as arguments.

I can include the datafusion_python crate with its incredibly helpful wrappers, structs and conversions. However, regular datafusion-python Python objects cannot be passed in because the datafusion Python package links to its own private Rust library rather than my independent Rust library.

pyo3 complains with:

TypeError: argument 'example_custom_expr': 'Expr' cannot be converted to 'Expr'.

This seems to be because the two Rust backends are not binary compatible.

Describe the solution you'd like
I would like to be able to point the datafusion-python Python frontend at a different Rust backend in order to make use of its great feature coverage and overall capability.

Would it be possible to override the default linking location?

Describe alternatives you've considered
The only way I can think to make this work would be to copy relevant chunks of Python code from datafusion-python package into my own Python code, and try to keep it synchronised.

Additional context
This would allow datafusion to be used as a component within more projects, especially as increasing backend work is being done by Rust with great end-user experience provided by Python.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions