Skip to content

Commit 103d3b2

Browse files
Metadata propagation both in DataFrame.corrwith and Dataframe.sum (#52923)
Fix the metadata propagation both in DataFrame.corrwith and Dataframe.sum
1 parent 7612ed3 commit 103d3b2

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

pandas/core/frame.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -10979,7 +10979,8 @@ def sum(
1097910979
min_count: int = 0,
1098010980
**kwargs,
1098110981
):
10982-
return super().sum(axis, skipna, numeric_only, min_count, **kwargs)
10982+
result = super().sum(axis, skipna, numeric_only, min_count, **kwargs)
10983+
return result.__finalize__(self, method="sum")
1098310984

1098410985
@doc(make_doc("prod", ndim=2))
1098510986
def prod(

pandas/tests/generic/test_finalize.py

-2
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,6 @@
177177
frame_data,
178178
operator.methodcaller("corrwith", pd.DataFrame(*frame_data)),
179179
),
180-
marks=not_implemented_mark,
181180
),
182181
pytest.param(
183182
(pd.DataFrame, frame_data, operator.methodcaller("count")),
@@ -414,7 +413,6 @@
414413
),
415414
pytest.param(
416415
(pd.DataFrame, frame_data, operator.methodcaller("sum")),
417-
marks=not_implemented_mark,
418416
),
419417
pytest.param(
420418
(pd.DataFrame, frame_data, operator.methodcaller("std")),

0 commit comments

Comments
 (0)