Skip to content

Commit 6c61d34

Browse files
committed
fixup
1 parent 586caee commit 6c61d34

File tree

3 files changed

+3
-18
lines changed

3 files changed

+3
-18
lines changed

doc/source/whatsnew/v1.3.0.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -363,7 +363,7 @@ Deprecations
363363
- Deprecated :meth:`core.window.ewm.ExponentialMovingWindow.vol` (:issue:`39220`)
364364
- Using ``.astype`` to convert between ``datetime64[ns]`` dtype and :class:`DatetimeTZDtype` is deprecated and will raise in a future version, use ``obj.tz_localize`` or ``obj.dt.tz_localize`` instead (:issue:`38622`)
365365
- Deprecated casting ``datetime.date`` objects to ``datetime64`` when used as ``fill_value`` in :meth:`DataFrame.unstack`, :meth:`DataFrame.shift`, :meth:`Series.shift`, and :meth:`DataFrame.reindex`, pass ``pd.Timestamp(dateobj)`` instead (:issue:`39767`)
366-
- Deprecated allowing partial failure in :meth:`Series.transform` and :meth:`DataFrame.transform` when ``func`` is list-like and dict-like; will raise if any function fails on column in a future version (:issue:`40211`)
366+
- Deprecated allowing partial failure in :meth:`Series.transform` and :meth:`DataFrame.transform` when ``func`` is list-like or dict-like; will raise if any function fails on column in a future version (:issue:`40211`)
367367

368368
.. ---------------------------------------------------------------------------
369369

pandas/core/apply.py

+2-3
Original file line numberDiff line numberDiff line change
@@ -286,11 +286,10 @@ def transform_dict_like(self, func):
286286
raise ValueError("Transform function failed")
287287
if len(failed_names) > 0:
288288
warnings.warn(
289-
f"Columns {failed_names} did not transform successfully. "
289+
f"{failed_names} did not transform successfully. "
290290
f"Allowing for partial failure is deprecated, this will raise "
291291
f"a ValueError in a future version of pandas."
292-
f"Drop these columns before calling transform to avoid"
293-
f"this warning.",
292+
f"Drop these columns/ops to avoid this warning.",
294293
FutureWarning,
295294
stacklevel=4,
296295
)

pandas/tests/apply/test_series_apply.py

-14
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020
timedelta_range,
2121
)
2222
import pandas._testing as tm
23-
from pandas.core.base import SpecificationError
2423
from pandas.tests.apply.common import series_transform_kernels
2524

2625

@@ -286,19 +285,6 @@ def test_transform_partial_failure(op, request):
286285
tm.assert_equal(result, expected)
287286

288287

289-
def test_transform_and_agg_error(string_series):
290-
# we are trying to transform with an aggregator
291-
msg = "cannot combine transform and aggregation"
292-
with pytest.raises(ValueError, match=msg):
293-
with np.errstate(all="ignore"):
294-
string_series.agg(["sqrt", "max"])
295-
296-
msg = "cannot perform both aggregation and transformation"
297-
with pytest.raises(ValueError, match=msg):
298-
with np.errstate(all="ignore"):
299-
string_series.agg({"foo": np.sqrt, "bar": "sum"})
300-
301-
302288
def test_demo():
303289
# demonstration tests
304290
s = Series(range(6), dtype="int64", name="series")

0 commit comments

Comments
 (0)