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

feat(python): Improve read_database when reading from Kùzu graph database #15218

Merged
merged 1 commit into from Mar 22, 2024

Conversation

alexander-beedie
Copy link
Collaborator

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

Can directly use get_as_pl() now; requires a new version of kuzu, but this seems reasonable. Added an optional "minimum_version" module/driver check to gracefully handle this - raises a ModuleUpgradeRequired exception if an insufficiently recent version is found.

Note that the next release of kuzu will also include an improvement1 in Arrow chunking inside get_as_pl(), meaning we'll no longer need to rechunk (will always get a single chunk from now on).

Footnotes

  1. https://github.com/kuzudb/kuzu/pull/3110

@github-actions github-actions bot added enhancement New feature or an improvement of an existing feature python Related to Python Polars labels Mar 21, 2024
@alexander-beedie alexander-beedie changed the title feat(python): improve DataFrame init from kuzu graph database feat(python): Improve frame init from kuzu graph database Mar 21, 2024
Copy link
Member

@stinodego stinodego left a comment

Choose a reason for hiding this comment

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

Nice! Just some very minor remarks.

py-polars/polars/io/database/_executor.py Show resolved Hide resolved
Copy link

codecov bot commented Mar 22, 2024

Codecov Report

Attention: Patch coverage is 80.95238% with 4 lines in your changes are missing coverage. Please review.

Project coverage is 81.26%. Comparing base (2a3b363) to head (a1c656a).
Report is 6 commits behind head on main.

❗ Current head a1c656a differs from pull request most recent head 81a59a7. Consider uploading reports for the commit 81a59a7 to get more accurate results

Files Patch % Lines
py-polars/polars/io/database/_executor.py 78.94% 2 Missing and 2 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main   #15218      +/-   ##
==========================================
+ Coverage   81.25%   81.26%   +0.01%     
==========================================
  Files        1354     1355       +1     
  Lines      175631   175657      +26     
  Branches     2518     2522       +4     
==========================================
+ Hits       142702   142743      +41     
+ Misses      32448    32431      -17     
- Partials      481      483       +2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Member

@stinodego stinodego left a comment

Choose a reason for hiding this comment

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

Looks good! Nice to have the minimum version too.

@stinodego stinodego changed the title feat(python): Improve frame init from kuzu graph database feat(python): Improve read_database when reading from Kùzu graph database Mar 22, 2024
@stinodego stinodego merged commit 4b2ef77 into pola-rs:main Mar 22, 2024
16 checks passed
@alexander-beedie alexander-beedie deleted the improved-kuzu-init branch March 22, 2024 12:59
@alexander-beedie alexander-beedie added the A-io-database Area: reading/writing to databases label Apr 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-io-database Area: reading/writing to databases enhancement New feature or an improvement of an existing feature python Related to Python Polars
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants