Skip to content

Fix explicit single-level boolean categories - #278

Open
AryanRG wants to merge 1 commit into
pydata:masterfrom
AryanRG:fix/single-boolean-level
Open

AryanRG wants to merge 1 commit into
pydata:masterfrom
AryanRG:fix/single-boolean-level

Conversation

@AryanRG

@AryanRG AryanRG commented Oct 24, 2026

Copy link
Copy Markdown

Boolean arrays with an explicit single category, such as C(x, levels=[True]), currently raise KeyError in the boolean fast path. Check that both levels exist before using that optimization, so single-level inputs use the normal categorical conversion.

Adds regression coverage for arrays, pandas Series, prediction reuse and unexpected values. Tox passed on Python 3.8–3.14 with and without pandas; formatting and package builds passed.

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.

1 participant