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: Cast the column and fill value to their common supertype #21509

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

I-Al-Istannen
Copy link

This ensures columns without any data (represented as the Null type) get the dtype of their replacement value in fill_null. This PR also adds a minimal testcase for the problem.

Closes #19738

…_null

This ensures columns without any data (represented as the `Null` type)
get the dtype of their replacement value in `fill_null`.
@github-actions github-actions bot added fix Bug fix python Related to Python Polars rust Related to Rust Polars labels Feb 27, 2025
Copy link

codecov bot commented Feb 27, 2025

Codecov Report

Attention: Patch coverage is 46.66667% with 8 lines in your changes missing coverage. Please review.

Project coverage is 79.81%. Comparing base (823bfc9) to head (ec912b3).
Report is 6 commits behind head on main.

Files with missing lines Patch % Lines
...tes/polars-plan/src/dsl/function_expr/fill_null.rs 46.66% 8 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main   #21509      +/-   ##
==========================================
+ Coverage   79.73%   79.81%   +0.08%     
==========================================
  Files        1605     1592      -13     
  Lines      230053   229280     -773     
  Branches     2623     2623              
==========================================
- Hits       183424   182996     -428     
+ Misses      46024    45679     -345     
  Partials      605      605              

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

@ritchie46
Copy link
Member

This isn't the proper solution. We need dynamic nested types instead of band aiding this in the fill_null.

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.

fill_null(pl.lit([])) on data with enforced schema but no entries makes to_arrow() panic
2 participants