Skip to content

fix(rust): Replace panic with error when sorting object dtype columns#26601

Open
Kevin-Patyk wants to merge 3 commits intopola-rs:mainfrom
Kevin-Patyk:fix/panic_sorting_dtype_schema
Open

fix(rust): Replace panic with error when sorting object dtype columns#26601
Kevin-Patyk wants to merge 3 commits intopola-rs:mainfrom
Kevin-Patyk:fix/panic_sorting_dtype_schema

Conversation

@Kevin-Patyk
Copy link
Contributor

Resolves #24677.

The introduced fix places a fast fail after the empty checks in sort_impl(...) and arg_sort(...). It checks if the column you want to sort by (sort key) is an Object data type using DataType::is_object(). If it is, it bails.

As a note, a test was updated in test_assert_frame_equal.py since it needed to match the exception.

Claude Sonnet 4.5 was used to help me navigate the codebase.

@github-actions github-actions bot added fix Bug fix rust Related to Rust Polars labels Feb 18, 2026
@codecov
Copy link

codecov bot commented Feb 18, 2026

Codecov Report

❌ Patch coverage is 80.00000% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 81.39%. Comparing base (4929540) to head (fec85ff).
⚠️ Report is 3 commits behind head on main.

Files with missing lines Patch % Lines
...ates/polars-core/src/chunked_array/ops/sort/mod.rs 60.00% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main   #26601      +/-   ##
==========================================
+ Coverage   81.37%   81.39%   +0.01%     
==========================================
  Files        1794     1794              
  Lines      244998   245008      +10     
  Branches     3079     3079              
==========================================
+ Hits       199379   199415      +36     
+ Misses      44833    44807      -26     
  Partials      786      786              

☔ 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 rust Related to Rust Polars

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Panic on sorting object dtype coming from schema

1 participant

Comments