Skip to content

Conversation

@mcrumiller
Copy link
Contributor

@mcrumiller mcrumiller commented Nov 21, 2025

Closes #25334.

If the series has nulls, then it's possible that the first tuple group will be the null group. We must ensure if drop_first=True that we drop the first non_null group, which may be the second group. So the .skip(...) sometimes gets it wrong. This fixes the issue.

I also combined some of the unit tests with parametrization for slightly better coverage.

@mcrumiller mcrumiller changed the title fix: to_dummies invalid usage of drop_first when nulls present fix: Invalid usage of drop_first in to_dummies when nulls present Nov 21, 2025
@github-actions github-actions bot added fix Bug fix python Related to Python Polars rust Related to Rust Polars and removed title needs formatting labels Nov 21, 2025
@mcrumiller mcrumiller marked this pull request as draft November 21, 2025 03:07
@mcrumiller mcrumiller marked this pull request as ready for review November 21, 2025 16:00
@codecov
Copy link

codecov bot commented Nov 21, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 82.16%. Comparing base (18e69ac) to head (dda79dd).

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #25435      +/-   ##
==========================================
- Coverage   82.16%   82.16%   -0.01%     
==========================================
  Files        1728     1728              
  Lines      240095   240100       +5     
  Branches     3028     3028              
==========================================
- Hits       197270   197267       -3     
- Misses      42045    42053       +8     
  Partials      780      780              

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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.

to_dummies applies drop_first before drop_nulls, causing unexpected behavior

1 participant