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: Fix elementwise-apply if any input is AggregatedScalar #15606

Merged
merged 4 commits into from Apr 12, 2024

Conversation

reswqa
Copy link
Collaborator

@reswqa reswqa commented Apr 12, 2024

This fixes #15602.

@github-actions github-actions bot added fix Bug fix python Related to Python Polars rust Related to Rust Polars labels Apr 12, 2024
if acs.iter().any(|ac| {
matches!(
ac.agg_state(),
AggState::AggregatedList(_) | AggState::AggregatedScalar(_)
Copy link
Collaborator Author

@reswqa reswqa Apr 12, 2024

Choose a reason for hiding this comment

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

IIUC, AggregatedScalar has the size equals to group len, It cannot do the fully element-wise apply. 🤔

Copy link
Member

Choose a reason for hiding this comment

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

I think it can if all acs are AggregatedScalar. I think any NotAggregated cannot combine with AggregatedList | AggregatedScalar (eg aggregated).

So if all are AggregatedScalar and the groups are equal we could still go int he elementwise, I think

Copy link
Collaborator Author

@reswqa reswqa Apr 12, 2024

Choose a reason for hiding this comment

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

So if all are AggregatedScalar and the groups are equal we could still go int he elementwise, I think

Yes, you're right. I just think this All AggregatedScalar condition could be relaxed, AggregatedScalar and Literal can also go to the element-wise branch, right?

@reswqa reswqa closed this Apr 12, 2024
@reswqa reswqa reopened this Apr 12, 2024
Copy link

codspeed-hq bot commented Apr 12, 2024

CodSpeed Performance Report

Merging #15606 will not alter performance

Comparing reswqa:agg_scalar_elementwise (df668e7) with main (23791bd)

Summary

✅ 22 untouched benchmarks

@reswqa reswqa marked this pull request as ready for review April 12, 2024 07:10
Copy link

codecov bot commented Apr 12, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 81.19%. Comparing base (44f1097) to head (df668e7).
Report is 27 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #15606      +/-   ##
==========================================
+ Coverage   81.16%   81.19%   +0.02%     
==========================================
  Files        1367     1370       +3     
  Lines      175307   175639     +332     
  Branches     2527     2530       +3     
==========================================
+ Hits       142296   142606     +310     
- Misses      32534    32559      +25     
+ Partials      477      474       -3     

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

Copy link
Member

@ritchie46 ritchie46 left a comment

Choose a reason for hiding this comment

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

Yeap, good one!

@ritchie46 ritchie46 merged commit 48615d5 into pola-rs:main Apr 12, 2024
24 checks passed
@reswqa reswqa deleted the agg_scalar_elementwise branch April 12, 2024 12:10
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.

PanicException caused by .is_between() inside .agg()
2 participants