DEPR: upcasting on invalid fill_value in unstack #53868
Labels
Deprecate
Functionality to remove in pandas
Dtype Conversions
Unexpected or buggy dtype conversions
Needs Discussion
Requires discussion from core team before further action
Reshaping
Concat, Merge/Join, Stack/Unstack, Explode
Pandas version checks
I have checked that this issue has not already been reported.
I have confirmed this bug exists on the latest version of pandas.
I have confirmed this bug exists on the main branch of pandas.
Reproducible Example
Issue Description
ATM in unstack (specifically in _Unstacker.get_new_values) we pass a
fill_value
tomaybe_promote
which upcasts on fill_values that can't be held normally. We only do this for numpy dtypes, not EADtypes, which is a not-great inconsistency.In the spirit of PDEP-6, should we consider deprecating this upcasting? Or like in #53802, maybe allow int->float?
Expected Behavior
NA
Installed Versions
Replace this line with the output of pd.show_versions()
The text was updated successfully, but these errors were encountered: