Skip to content

Conversation

jbrockmendel
Copy link
Member

old_dtype = dtype
dtype, fill_value = maybe_promote(dtype, fill_value)
if old_dtype != dtype:
if old_dtype.kind not in "iub":
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Curious why we only need to warn for these numeric types.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

for int/bool dtypes, we can introduce NaNs which entail upcasting. For all other dtypes we should be able to unstack without having to upcast. same idea as not warning on int/bool in PDEP6

@mroeschke mroeschke added the Deprecate Functionality to remove in pandas label Sep 8, 2025
@mroeschke mroeschke added this to the 3.0 milestone Sep 8, 2025
@mroeschke mroeschke merged commit 20fc744 into pandas-dev:main Sep 8, 2025
42 checks passed
@mroeschke
Copy link
Member

Thanks @jbrockmendel

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Deprecate Functionality to remove in pandas
Projects
None yet
2 participants