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: Correct hash and fmt for struct expr #11119

Merged
merged 1 commit into from
Sep 14, 2023
Merged

Conversation

reswqa
Copy link
Collaborator

@reswqa reswqa commented Sep 14, 2023

AExpr containing StructFunction::FieldByName with different field names were calculated to have the same hash value, resulting in incorrect reuse by cse.

This fixes #11116.

@github-actions github-actions bot added fix Bug fix python Related to Python Polars rust Related to Rust Polars labels Sep 14, 2023
@@ -240,6 +240,8 @@ impl Hash for FunctionExpr {
FunctionExpr::Boolean(f) => f.hash(state),
#[cfg(feature = "strings")]
FunctionExpr::StringExpr(f) => f.hash(state),
#[cfg(feature = "dtype-struct")]
FunctionExpr::StructExpr(f) => f.hash(state),
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Maybe ListExpr and ArrayExpr also needs to be treated similarly?

Copy link
Member

Choose a reason for hiding this comment

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

Yes, the more complete the better. 👍

@ritchie46 ritchie46 merged commit 78742ff into pola-rs:main Sep 14, 2023
26 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.

Repeated struct field get gives incorrect output in lazyframe
2 participants