Skip to content

Conversation

mzeitlin11
Copy link
Member

@mzeitlin11 mzeitlin11 added Bug Dtype Conversions Unexpected or buggy dtype conversions NA - MaskedArrays Related to pd.NA and nullable extension arrays Reshaping Concat, Merge/Join, Stack/Unstack, Explode labels Sep 4, 2021
@jreback jreback added this to the 1.4 milestone Sep 5, 2021
tm.assert_frame_equal(result, expected)


def test_concat_bool_boolean():
Copy link
Contributor

Choose a reason for hiding this comment

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

can you parameterize and also include a bool series here as a test (e.g. no boolean, just plain bool)

Copy link
Member Author

Choose a reason for hiding this comment

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

Have added other combinations

Copy link
Contributor

@jreback jreback left a comment

Choose a reason for hiding this comment

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

lgtm. comment for possible followup

# Handle only boolean + np.bool_ -> boolean, since other cases like
# Int64 + boolean -> Int64 will be handled by the other type
if all(
isinstance(t, BooleanDtype)
Copy link
Contributor

Choose a reason for hiding this comment

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

is_bool_dtype should work here no?

that said i think we are using mostly this type of pattern, which i am actually not much of a fan of. so ok for this PR. but we should ideally be using the common accessors rather than writing new ones for EA types, can you open an issue about this.

Copy link
Member Author

Choose a reason for hiding this comment

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

Ok, will do

@jreback jreback merged commit 8578696 into pandas-dev:master Sep 7, 2021
@mzeitlin11 mzeitlin11 deleted the boolean_concat branch September 7, 2021 22:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Bug Dtype Conversions Unexpected or buggy dtype conversions NA - MaskedArrays Related to pd.NA and nullable extension arrays Reshaping Concat, Merge/Join, Stack/Unstack, Explode

Projects

None yet

Development

Successfully merging this pull request may close these issues.

BUG: concat behaves differently for bool/boolean dtypes than it does for int64/Int64

2 participants