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

support extendr_polars #326

Merged
merged 14 commits into from
Sep 2, 2023
Merged

support extendr_polars #326

merged 14 commits into from
Sep 2, 2023

Conversation

sorhawell
Copy link
Collaborator

This PR will add support for extendr_polars which allows rust extensions to polars in R. Examples

@sorhawell sorhawell changed the title WIP: support extendr_polars support extendr_polars Sep 1, 2023
@sorhawell
Copy link
Collaborator Author

sorhawell commented Sep 1, 2023

this update is needed to support the crate extendr_polars

extendr_polars crate allows an R package developer to interface with the polars R package via arrow-import/export r-polars of DataFrame. This is zero cost and much safer than transmuting the inner rust-polars DataFrame between compilation units and differing versions.

an example R package is found here (test examples)

Rust side use example
(example R package will not work before polars 0.8.0 with this PR included)

@sorhawell sorhawell mentioned this pull request Sep 1, 2023
@etiennebacher etiennebacher marked this pull request as ready for review September 1, 2023 16:03
Copy link
Collaborator

@etiennebacher etiennebacher left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@sorhawell I can approve if you want but I have no clue if this is good or if there are mistake. I suppose it works fine since you made some tests repos using it, but maybe @eitsupi would be more comfortable reviewing this?

Copy link
Collaborator

@eitsupi eitsupi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, I don't have enough knowledge to review this.......

src/rust/src/arrow_interop/to_rust.rs Outdated Show resolved Hide resolved
@sorhawell
Copy link
Collaborator Author

@etiennebacher arrow-protocol is really hairy ^^ I have looked in the sparse official arrow docs for days to get an ok understanding.

I have added a round trip unit test with b38f4d8 and added some notes for what is going on and when to use this.

@sorhawell sorhawell merged commit cc124b3 into main Sep 2, 2023
@sorhawell sorhawell deleted the extendr_polars branch September 2, 2023 21:53
@eitsupi
Copy link
Collaborator

eitsupi commented Sep 3, 2023

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants