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

fix(rust,python): ensure projections containing only hive columns are projected #11803

Merged
merged 9 commits into from
Oct 17, 2023

Conversation

nameexhaustion
Copy link
Collaborator

@nameexhaustion nameexhaustion commented Oct 17, 2023

Fixes #11796 (regression introduced by #11690).

This adds back the num_rows arg and includes some more detail in the comment above the function, as well as a test case.

Also did some refactoring around to calculate the projection_height upfront, which ended up causing the test from #11578 to fail. This PR also improves on that fix to make it more robust.

I'm not actually certain exactly why it fails, but it's likely that the fix done by #11578 was happened to produce the correct results because row groups prior to the last were always calling column_idx_to_series with the total number of rows remaining to read from the current row group as well as all subsequent row groups (*remaining_rows), which would always be > md.num_rows. However this PR changes that to call column_idx_to_series with projection_height, which is now always <= md.num_rows().

@github-actions github-actions bot added fix Bug fix python Related to Python Polars rust Related to Rust Polars labels Oct 17, 2023
@ritchie46
Copy link
Member

Nice, can you do a clippy run and undraft? Then it could make the release. 👀

@nameexhaustion
Copy link
Collaborator Author

on it - my local clippy is broken atm 😅 so have been relying on the CI

@nameexhaustion
Copy link
Collaborator Author

nameexhaustion commented Oct 17, 2023

I've taken it out of draft - if the CI tests are ok then it can be merged

@nameexhaustion
Copy link
Collaborator Author

btw, when you say making the release... I noticed the py-polars 0.19.9 commit was already merged at #11791 - so hasn't it already been released? or does it work differently?

@ritchie46 ritchie46 merged commit 8d29d3c into pola-rs:main Oct 17, 2023
24 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
fix Bug fix python Related to Python Polars rust Related to Rust Polars
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Problem with empty dataframe being returned when querying with only hive partition column.
2 participants