API: combine casting behavior with extension types #42198
Labels
API - Consistency
Internal Consistency of API/Behavior
Closing Candidate
May be closeable, needs more eyeballs
Dtype Conversions
Unexpected or buggy dtype conversions
ExtensionArray
Extending pandas with custom dtypes or arrays.
NA - MaskedArrays
Related to pd.NA and nullable extension arrays
In
combine
, current behavior tries to maintain extension types by casting back if possible throughmaybe_cast_pointwise_result
. This can give some value dependent behavior with a (contrived) example like the following:Not sure if that is desired behavior on its own, but it presents an issue for fixing #42137. On current master object boolean data raises in
IntegerArray._from_sequence
, socombine
fails to cast back:However, fixing #42137 will allow casting back, changing this behavior to
which looks unexpected (and fails
pandas/tests/extension/test_integer.py::TestMethods::test_combine_le
section of tests).The text was updated successfully, but these errors were encountered: