Skip to content

Commit 9f71625

Browse files
jbrockmendeljorisvandenbossche
authored andcommitted
CLN: Remove incorrect check, comment, rename (#27922)
1 parent 9a244b5 commit 9f71625

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

pandas/core/ops/__init__.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -730,9 +730,12 @@ def wrapper(self, other, axis=None):
730730
)
731731

732732
result = self._constructor(res_values, index=self.index)
733-
# rename is needed in case res_name is None and result.name
734-
# is not.
735-
return finalizer(result).rename(res_name)
733+
result = finalizer(result)
734+
735+
# Set the result's name after finalizer is called because finalizer
736+
# would set it back to self.name
737+
result.name = res_name
738+
return result
736739

737740
wrapper.__name__ = op_name
738741
return wrapper

0 commit comments

Comments
 (0)