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 list.mean and list.median returning Float64 for temporal types #21144

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

lukemanley
Copy link
Contributor

@lukemanley lukemanley commented Feb 8, 2025

closes #17639
closes #19917

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

codecov bot commented Feb 8, 2025

Codecov Report

Attention: Patch coverage is 97.36842% with 1 line in your changes missing coverage. Please review.

Project coverage is 79.88%. Comparing base (e8e0295) to head (5655f0b).
Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
crates/polars-plan/src/dsl/function_expr/schema.rs 93.33% 1 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main   #21144   +/-   ##
=======================================
  Coverage   79.88%   79.88%           
=======================================
  Files        1593     1593           
  Lines      227649   227683   +34     
  Branches     2600     2600           
=======================================
+ Hits       181860   181895   +35     
+ Misses      45192    45191    -1     
  Partials      597      597           

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

@orlp
Copy link
Collaborator

orlp commented Feb 8, 2025

Unfortunately it's not that simple to just cast back to the input type. Take a look at crates/polars-expr/src/reduce/mean.rs and see the corner cases handled there in finish_output. We should probably centralize this logic somewhere...

@lukemanley
Copy link
Contributor Author

Unfortunately it's not that simple to just cast back to the input type. Take a look at crates/polars-expr/src/reduce/mean.rs and see the corner cases handled there in finish_output. We should probably centralize this logic somewhere...

Thanks @orlp. I've updated to handle those cases although this does not centralize that logic.

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.

Inconsistent type casting of datetime in functions on List column list.mean converts duration to float
2 participants