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 Polars DataFrame export from QueryResult #2985

Merged
merged 1 commit into from
Mar 4, 2024

Conversation

alexander-beedie
Copy link
Contributor

@alexander-beedie alexander-beedie commented Mar 2, 2024

Closes #1662 (allow export to Polars as well as Pandas).

Hi, thought this might be helpful; I'm one of the Polars devs, so took a look at it. As @pankajp mentioned, Polars can zero-copy init from Arrow, so very little new code was required to enable this. Instead I put most of the focus into generalising the existing Arrow unit tests so that they can also validate the Polars results, ensuring good code coverage. Hope this is welcome!

FYI: I'm also enabling kuzu support on the Polars side (via our read_database init method); there's a nice symmetry (and broader discoverability) in having the functionality available in both APIs 👌 (See: pola-rs/polars#14822, which was just merged).

(Looking at kuzu I think there may be some good use-cases for it at work too, so I'm going to turn a few people on to this; thanks for the great work :)

@mewim
Copy link
Member

mewim commented Mar 3, 2024

LGTM. The CI will not pass because we used a few internal secrets in our tests which external contributors do not have access to. We might have to reorder the CI pipeline to make sure that at least the Python tests pass on the platforms we support to merge this.

@semihsalihoglu-uw
Copy link
Contributor

Thanks a lot for the contribution @alexander-beedie. Happy to chat with you and your colleagues if you want to use Kuzu at your work. Please reach out to us over Discord.

Copy link
Member

@prrao87 prrao87 left a comment

Choose a reason for hiding this comment

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

These changes look great! Thanks a lot for the PR!

@prrao87
Copy link
Member

prrao87 commented Mar 4, 2024

@alexander-beedie I took a look at the ConnectionExecutor and it looks great! Once it's in the next release I'll do a thread describing its use and here's looking forward to bringing more Polars users to Kùzu and vice versa :)

@alexander-beedie
Copy link
Contributor Author

alexander-beedie commented Mar 4, 2024

@alexander-beedie I took a look at the ConnectionExecutor and it looks great! Once it's in the next release I'll do a thread describing its use and here's looking forward to bringing more Polars users to Kùzu and vice versa :)

Sounds good to me; was one of our users that pointed me in this direction, and it looks really promising. I'm sure there will be some use-cases where clean interop between the two will lead to some powerful pipelines/capabilities 😎

@mewim mewim merged commit 0d84c73 into kuzudb:master Mar 4, 2024
9 of 13 checks passed
@alexander-beedie alexander-beedie deleted the polars-export-support branch March 4, 2024 08:51
@andyfengHKU andyfengHKU mentioned this pull request Apr 15, 2024
32 tasks
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.

Support for working with DataFrames in Polars
4 participants