Support Polars DataFrame export from QueryResult #2985
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 ourread_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 :)