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: binary agg should group aware if literal not a scalar #12043

Merged
merged 2 commits into from
Oct 26, 2023

Conversation

reswqa
Copy link
Collaborator

@reswqa reswqa commented Oct 26, 2023

This fixes #11989.

@github-actions github-actions bot added fix Bug fix python Related to Python Polars rust Related to Rust Polars labels Oct 26, 2023
1 => self.apply_elementwise(ac_l, ac_r, false),
_ => self.apply_group_aware(ac_l, ac_r),
},
(AggState::Literal(_), AggState::Literal(_)) => self.apply_group_aware(ac_l, ac_r),
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I'm not sure about this(all literal), but just think they should return the same values for every group. 🤔

Copy link
Member

Choose a reason for hiding this comment

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

Can we do something smart here? Compute only once and then expand as list over the groups.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

That's reasonable. I updated the code But not sure if this is what you want.

@reswqa reswqa marked this pull request as ready for review October 26, 2023 08:15
1 => self.apply_elementwise(ac_l, ac_r, false),
_ => self.apply_group_aware(ac_l, ac_r),
},
(AggState::Literal(_), AggState::Literal(_)) => self.apply_group_aware(ac_l, ac_r),
Copy link
Member

Choose a reason for hiding this comment

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

Can we do something smart here? Compute only once and then expand as list over the groups.

@ritchie46 ritchie46 merged commit e7d3f04 into pola-rs:main Oct 26, 2023
24 checks passed
@reswqa reswqa deleted the binary_agg branch October 26, 2023 13:02
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.

.dot() is being passed full column in a groupby context
2 participants