Thanks to visit codestin.com
Credit goes to github.com

Skip to content

How to make 3rd party rust types available to the VM #5459

@directindex

Description

@directindex

Summary

I'm building a little data processing application, in which I'd like be able to add data transformations that are written in python but will be executed by rust under the hood. Eventually I want provide a polars dataframe, and modify it via python.

Something like this:

def transform(df):
    df = df.with_columns(
        (pl.col("x") * 2).alias("twice")
    ).collect()
    
    return df

I'm already hitting a road block getting the dataframe in and out of the VM. I tried to build on top of the call_between_rust_and_python example, but it only works with types that are already supported by rustpython or on simple types that are composed of supported types.

I'd be very happy if you'd nugde me into the right direction, given if it's actually possible what I'm trying to achieve.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions