Skip to content

Fix mixed-type categorical sorting crashes (fixes #273)#336

Merged
oegedijk merged 1 commit intomasterfrom
fix-273-categorical-sorting
Feb 6, 2026
Merged

Fix mixed-type categorical sorting crashes (fixes #273)#336
oegedijk merged 1 commit intomasterfrom
fix-273-categorical-sorting

Conversation

@oegedijk
Copy link
Owner

@oegedijk oegedijk commented Feb 6, 2026

Summary

  • fix issue Categorical columns #273 by hardening categorical sorting against mixed types and missing values
  • add a shared sorted_categorical_values(...) helper and reuse it across explainer setup, categorical ordering, PDP grid generation, and categorical plot code paths
  • harden plotly_shap_violin_plot for non-string category labels
  • add regression tests for mixed categorical values in plots and mixed target-label fallback sorting
  • update release notes and move TODO Now to the next item

Files touched

  • explainerdashboard/explainer_methods.py
  • explainerdashboard/explainers.py
  • explainerdashboard/explainer_plots.py
  • tests/test_datasets.py
  • tests/test_categorical_sorting.py
  • RELEASE_NOTES.md
  • TODO.md

Validation

  • uv run pytest tests/test_datasets.py tests/test_categorical_sorting.py -q
    • result: 9 passed

Fixes #273

@oegedijk oegedijk merged commit b0bc508 into master Feb 6, 2026
12 checks passed
@oegedijk oegedijk deleted the fix-273-categorical-sorting branch February 6, 2026 22:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Categorical columns

1 participant