From 4f216151218590dee305e85dc509e113ba3665c7 Mon Sep 17 00:00:00 2001 From: richard Date: Thu, 22 Dec 2022 17:02:19 -0500 Subject: [PATCH] CLN: Remove unused rewrite warning --- pandas/core/reshape/pivot.py | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/pandas/core/reshape/pivot.py b/pandas/core/reshape/pivot.py index 810a428098df2..eb95bb2484ebf 100644 --- a/pandas/core/reshape/pivot.py +++ b/pandas/core/reshape/pivot.py @@ -21,7 +21,6 @@ Appender, Substitution, ) -from pandas.util._exceptions import rewrite_warning from pandas.core.dtypes.cast import maybe_downcast_to_dtype from pandas.core.dtypes.common import ( @@ -165,17 +164,7 @@ def __internal_pivot_table( values = list(values) grouped = data.groupby(keys, observed=observed, sort=sort) - msg = ( - "pivot_table dropped a column because it failed to aggregate. This behavior " - "is deprecated and will raise in a future version of pandas. Select only the " - "columns that can be aggregated." - ) - with rewrite_warning( - target_message="The default value of numeric_only", - target_category=FutureWarning, - new_message=msg, - ): - agged = grouped.agg(aggfunc) + agged = grouped.agg(aggfunc) if dropna and isinstance(agged, ABCDataFrame) and len(agged.columns): agged = agged.dropna(how="all")