Skip to content

How do I bring dependencies in my binding? #737

@dariocurr

Description

@dariocurr

Hi guys, I'm Dario.
I have been struggling with an issue and I am trying to understand it.

I am trying to create my own cross-language library on top of datafusion and datafusion-python.
Let's call this library my-library.

I created a rust workspace and I have two crates:

  • my-library, to be used by other rust crates
  • my-library-python, to be used by other Python packages

my-library has datafusion as a dependency and has just one function returning a datafusion::execution::context::SessionContext

my-library-python, has datafusion-python as a dependency and has just one function wrapping the datafusion::execution::context::SessionContext in a datafusion_python::context::PySessionContext

Now. when I install my-library-python in my python env through maturin develop and try to play with the SessionContext returned by the binding as follows:

python
ctx = my_library.get_context()
datafusion_df = ctx.sql(query)

I get the following error

pyo3_runtime.PanicException: called `Result::unwrap()` on an `Err` value: PyErr { type: <class 'ModuleNotFoundError'>, value: ModuleNotFoundError("No module named 'datafusion'"), traceback: None }

My question then is:
Why should I add datafusion as a dependency in my python package, duplicating the library?
Is there a way to bring the dependency in my binding?

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions