Skip to content

Commit 13ba267

Browse files
committed
REF: Decouple Series.apply from Series.agg (#53400)
1 parent c292c5b commit 13ba267

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

pandas/tests/apply/test_series_apply.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -398,13 +398,14 @@ def test_agg_evaluate_lambdas(string_series):
398398
assert isinstance(result, Series) and len(result) == len(string_series)
399399

400400

401-
def test_with_nested_series(datetime_series):
401+
@pytest.mark.parametrize("op_name", ["agg", "apply"])
402+
def test_with_nested_series(datetime_series, op_name):
402403
# GH 2316
403404
# .agg with a reducer and a transform, what to do
404405
msg = "Returning a DataFrame from Series.apply when the supplied function"
405406
with tm.assert_produces_warning(FutureWarning, match=msg):
406407
# GH52123
407-
result = datetime_series.apply(
408+
result = getattr(datetime_series, op_name)(
408409
lambda x: Series([x, x**2], index=["x", "x^2"])
409410
)
410411
expected = DataFrame({"x": datetime_series, "x^2": datetime_series**2})

0 commit comments

Comments
 (0)