-
I have a FFI program that reads in a numpy array and polars DataFrame, does some aggregations in parallel and then returns a DataFrame. As part of this I need to supply the borrowed ArrayView into a closure which needs to be Yesterday I posted this on StackOverflow. If you replace the Asking here because the situation seems more likely to happen using the First thing to answer is: Is this a justifiable thing to do? From my understanding the ArrayView can be treated as ``static` in this particular usage of the FFI. Moving forward, two solutions I can see is via a transmute (see StackOverflow answer), or to wrap up the RawArrayView in a new type and unsafely implement Send + Sync. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
I'm not that familiar with polars but it looks like you can avoid this by just not using a lazy dataframe (which in your code there is no reason to anyway).
This is a bad idea; don't do this. |
Beta Was this translation helpful? Give feedback.
I'm not that familiar with polars but it looks like you can avoid this by just not using a lazy dataframe (which in your code there is no reason to anyway).
This is a bad idea; don't do this.