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: Upcast small integer dtypes for rolling sum operations #21397

Merged
merged 1 commit into from
Feb 22, 2025

Conversation

lukemanley
Copy link
Contributor

fixes #21318

Updates Expr.rolling_sum and Expr.rolling_sum_by to upcast small integer dtypes to Int64 to be consistent with other sum operations such as Expr.sum and Expr.cum_sum.

@github-actions github-actions bot added fix Bug fix python Related to Python Polars rust Related to Rust Polars labels Feb 22, 2025
Copy link

codecov bot commented Feb 22, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 79.95%. Comparing base (3719977) to head (bfdbf31).
Report is 3 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #21397      +/-   ##
==========================================
+ Coverage   79.89%   79.95%   +0.06%     
==========================================
  Files        1597     1597              
  Lines      228951   228968      +17     
  Branches     2618     2618              
==========================================
+ Hits       182915   183081     +166     
+ Misses      45437    45288     -149     
  Partials      599      599              

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

@ritchie46 ritchie46 merged commit 62bc08b into pola-rs:main Feb 22, 2025
26 of 27 checks passed
s.dtype(),
DataType::Int8 | DataType::UInt8 | DataType::Int16 | DataType::UInt16
) {
s = s.cast(&DataType::Int64).unwrap();
Copy link
Collaborator

Choose a reason for hiding this comment

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

It be nice if this cast could be promoted into the logical plan type coercion phase so that we don't have to mimic this behaviour in the gpu engine too.

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.

rolling_sum with small integer types does not cast to Int64
3 participants