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(python,rust): Allow append/zip_with/extend on local categoricals #12369

Merged
merged 14 commits into from
Nov 15, 2023

Conversation

c-peters
Copy link
Collaborator

fix #12091
fix #10393

@github-actions github-actions bot added fix Bug fix python Related to Python Polars rust Related to Rust Polars labels Nov 10, 2023
@s-banach
Copy link
Contributor

Sorry to bother you! Just wondering whether there's a path from here to joining on local categoricals.

fn merge_local_rhs_categorical<'a>(
categories: &'a Utf8Array<i64>,
ca_right: &'a CategoricalChunked,
) -> Result<(impl Iterator<Item = Option<u32>> + 'a, Arc<RevMapping>), PolarsError> {
Copy link
Member

Choose a reason for hiding this comment

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

I see that the finish always takes a materialized CategoricalChunked.

I think for now we must then update this return type. That means we don't have to return a "flattened" iterator, but can materialize via apply_generic which will ensure we traverse in the most optimal way.

But let's first get the bugs fixed and improve in a follow up PR.

@ritchie46 ritchie46 merged commit 1b9bbdb into pola-rs:main Nov 15, 2023
23 checks passed
@deanm0000
Copy link
Collaborator

Sorry to bother you! Just wondering whether there's a path from here to joining on local categoricals.

In the interim, pyarrow will join tables by categorical

pl.from_arrow(
df1.to_arrow().join(
df2.to_arrow(), keys='cat_col')
)

@c-peters
Copy link
Collaborator Author

Yes, in the future it would be possible to join on local categoricals with this merge operation.

@c-peters c-peters deleted the merge_cats branch November 16, 2023 10:43
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.

Incorrect merge of categorical columns if they overlap Add synchronize_categoricals()
4 participants