Skip to content

Commit 3112a5a

Browse files
moha-rkrrvsrafael
andcommitted
Fixed metadata propagation in Dataframe.apply
Co-authored-by: Mohamad Rkein <[email protected]> Co-authored-by: Rafael Rodrigues <[email protected]>
1 parent 0b70818 commit 3112a5a

File tree

3 files changed

+2
-2
lines changed

3 files changed

+2
-2
lines changed

doc/source/whatsnew/v1.4.0.rst

+1
Original file line numberDiff line numberDiff line change
@@ -571,6 +571,7 @@ Reshaping
571571
- Bug in :func:`concat` would fail when the ``objs`` argument all had the same index and the ``keys`` argument contained duplicates (:issue:`43595`)
572572
- Bug in :func:`concat` which ignored the ``sort`` parameter (:issue:`43375`)
573573
- Fixed bug in :func:`merge` with :class:`MultiIndex` as column index for the ``on`` argument returning an error when assigning a column internally (:issue:`43734`)
574+
- Fixed metadata propagation in :class:`Dataframe.apply` method (:issue:`28283`)
574575

575576
Sparse
576577
^^^^^^

pandas/core/frame.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -8866,7 +8866,7 @@ def apply(
88668866
args=args,
88678867
kwargs=kwargs,
88688868
)
8869-
return op.apply()
8869+
return op.apply().__finalize__(self, method="apply")
88708870

88718871
def applymap(
88728872
self, func: PythonFuncType, na_action: str | None = None, **kwargs

pandas/tests/generic/test_finalize.py

-1
Original file line numberDiff line numberDiff line change
@@ -472,7 +472,6 @@
472472
(pd.Series, ([1],), operator.methodcaller("apply", lambda x: x)),
473473
pytest.param(
474474
(pd.DataFrame, frame_mi_data, operator.methodcaller("apply", lambda x: x)),
475-
marks=not_implemented_mark,
476475
),
477476
# Cumulative reductions
478477
(pd.Series, ([1],), operator.methodcaller("cumsum")),

0 commit comments

Comments
 (0)