Skip to content

Commit

Permalink
fixup
Browse files Browse the repository at this point in the history
  • Loading branch information
rhshadrach committed Mar 5, 2021
1 parent 586caee commit 6c61d34
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 18 deletions.
2 changes: 1 addition & 1 deletion doc/source/whatsnew/v1.3.0.rst
Original file line number Diff line number Diff line change
Expand Up @@ -363,7 +363,7 @@ Deprecations
- Deprecated :meth:`core.window.ewm.ExponentialMovingWindow.vol` (:issue:`39220`)
- 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`)
- 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`)
- 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`)
- 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`)

.. ---------------------------------------------------------------------------
Expand Down
5 changes: 2 additions & 3 deletions pandas/core/apply.py
Original file line number Diff line number Diff line change
Expand Up @@ -286,11 +286,10 @@ def transform_dict_like(self, func):
raise ValueError("Transform function failed")
if len(failed_names) > 0:
warnings.warn(
f"Columns {failed_names} did not transform successfully. "
f"{failed_names} did not transform successfully. "
f"Allowing for partial failure is deprecated, this will raise "
f"a ValueError in a future version of pandas."
f"Drop these columns before calling transform to avoid"
f"this warning.",
f"Drop these columns/ops to avoid this warning.",
FutureWarning,
stacklevel=4,
)
Expand Down
14 changes: 0 additions & 14 deletions pandas/tests/apply/test_series_apply.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
timedelta_range,
)
import pandas._testing as tm
from pandas.core.base import SpecificationError
from pandas.tests.apply.common import series_transform_kernels


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


def test_transform_and_agg_error(string_series):
# we are trying to transform with an aggregator
msg = "cannot combine transform and aggregation"
with pytest.raises(ValueError, match=msg):
with np.errstate(all="ignore"):
string_series.agg(["sqrt", "max"])

msg = "cannot perform both aggregation and transformation"
with pytest.raises(ValueError, match=msg):
with np.errstate(all="ignore"):
string_series.agg({"foo": np.sqrt, "bar": "sum"})


def test_demo():
# demonstration tests
s = Series(range(6), dtype="int64", name="series")
Expand Down

0 comments on commit 6c61d34

Please sign in to comment.