Skip to content

Commit 5512119

Browse files
committed
put exact_match as the first condition
1 parent 593dda1 commit 5512119

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

pandas/core/internals/blocks.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -865,9 +865,9 @@ def setitem(self, indexer, value):
865865
values[indexer] = value
866866

867867
elif (
868-
is_categorical_dtype(arr_value.dtype)
868+
exact_match
869+
and is_categorical_dtype(arr_value.dtype)
869870
and not is_categorical_dtype(values)
870-
and exact_match
871871
):
872872
# GH25495 - If the current dtype is not categorical,
873873
# we need to create a new categorical block

0 commit comments

Comments
 (0)