Skip to content

Commit 1a8602d

Browse files
committed
Added note and removed potentially confusing docs from __fianlize__.
1 parent 15adcd7 commit 1a8602d

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

pandas/core/generic.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6110,8 +6110,7 @@ def __finalize__(self, other, method: str | None = None, **kwargs) -> Self:
61106110
other : the object from which to get the attributes that we are going
61116111
to propagate. If ``other`` has an ``input_objs`` attribute, then
61126112
this attribute must contain an iterable of objects, each with an
6113-
``attrs`` attribute, in which case, each such ``attrs`` instance
6114-
must be a dictionary that is equal to all of the others.
6113+
``attrs`` attribute.
61156114
method : str, optional
61166115
A passed method name providing context on where ``__finalize__``
61176116
was called.
@@ -6120,6 +6119,12 @@ def __finalize__(self, other, method: str | None = None, **kwargs) -> Self:
61206119
61216120
The value passed as `method` are not currently considered
61226121
stable across pandas releases.
6122+
6123+
Notes
6124+
-----
6125+
In case ``other`` has an ``input_objs`` attribute, this method only
6126+
propagates its metadata if each object in ``input_objs`` has the exact
6127+
same metadata as the others.
61236128
"""
61246129
if isinstance(other, NDFrame):
61256130
if other.attrs:

0 commit comments

Comments
 (0)