Skip to content

Commit 45e2ad0

Browse files
committed
Fix: Prioritizing False if self.flags.allows_duplicate_labels or other.flags.allows_duplicate_labels is False
1 parent 155a9d1 commit 45e2ad0

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

Diff for: pandas/core/generic.py

+4-2
Original file line numberDiff line numberDiff line change
@@ -6076,8 +6076,10 @@ def __finalize__(self, other, method: str | None = None, **kwargs) -> Self:
60766076
# One could make the deepcopy unconditionally, but a deepcopy
60776077
# of an empty dict is 50x more expensive than the empty check.
60786078
self.attrs = deepcopy(other.attrs)
6079-
6080-
self.flags.allows_duplicate_labels = other.flags.allows_duplicate_labels
6079+
self.flags.allows_duplicate_labels = (
6080+
self.flags.allows_duplicate_labels
6081+
and other.flags.allows_duplicate_labels
6082+
)
60816083
# For subclasses using _metadata.
60826084
for name in set(self._metadata) & set(other._metadata):
60836085
assert isinstance(name, str)

0 commit comments

Comments
 (0)