-
-
Notifications
You must be signed in to change notification settings - Fork 18.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
BUG: find_common_type incorrect for Categorical with NaNs #38240
Comments
This is not a "bug", but rather unfortunate but intentional behaviour. We handle this specifically here: pandas/pandas/core/dtypes/concat.py Lines 60 to 75 in 22dbef1
See this comment on the original PR about exactly this case: #33607 (comment) This whole We should also see if we can actually change this behaviour, to get rid of the value-dependent behaviour (which I think we generally want). But that doesn't seem easy to deprecate, so might be 2.0 material. |
Marking as blocker for 1.4rc; we should make a decision about deprecation before then. |
I agree i am not sure how you would deprecate this. |
How about I put together a PR for what it would look like to change directly in 2.0 and based on that see if a decent way of doing a deprecation for 1.4 pops out? |
sgtm |
We could raise a deprecation warning when the categorical gets cast to int and that succeeds (so not falling back to object). People could avoid the deprecation warning by casting to object dtype (or to int dtype if they want that) in advance. I don't think this will be a very common case, so it might not be problematic to actually warn about this. |
No real progress on a branch here. Removing blocker-for-RC label. |
xref #37930; I expect this would also be relevant for #19371
The text was updated successfully, but these errors were encountered: