API: Categorical constructor with dtype raise instead of casting to NA #40996
Labels
API - Consistency
Internal Consistency of API/Behavior
Categorical
Categorical Data Type
Constructors
Series/DataFrame/Index/pd.array Constructors
Error Reporting
Incorrect or improved errors from pandas
Casting "foo" to pd.NaT here makes very little sense to me, and does not match the behavior of any of our other constructors. I'm pretty sure this is why we have to do so much special-casing for Categorical in dtypes.cast and groupby ops.
Suggestion: we change/deprecate the behavior to raise instead of cast.
The text was updated successfully, but these errors were encountered: