Skip to content

Commit 601ffaf

Browse files
jbrockmendelproost
authored andcommitted
DEPR: enforce kwarg deprecations in plotting, Categorical.fillna (pandas-dev#30190)
1 parent 18b0905 commit 601ffaf

File tree

6 files changed

+5
-26
lines changed

6 files changed

+5
-26
lines changed

doc/source/whatsnew/v1.0.0.rst

+5
Original file line numberDiff line numberDiff line change
@@ -629,6 +629,11 @@ or ``matplotlib.Axes.plot``. See :ref:`plotting.formatters` for more.
629629
- Changed the default value for ``ordered`` in :class:`CategoricalDtype` from ``None`` to ``False`` (:issue:`26336`)
630630
- :meth:`Series.set_axis` and :meth:`DataFrame.set_axis` now require "labels" as the first argument and "axis" as an optional named parameter (:issue:`30089`)
631631
-
632+
- Removed the previously deprecated keyword "fill_value" from :meth:`Categorical.fillna`, use "value" instead (:issue:`19269`)
633+
- Removed the previously deprecated keyword "data" from :func:`andrews_curves`, use "frame" instead (:issue:`6956`)
634+
- Removed the previously deprecated keyword "data" from :func:`parallel_coordinates`, use "frame" instead (:issue:`6956`)
635+
- Removed the previously deprecated keyword "colors" from :func:`parallel_coordinates`, use "color" instead (:issue:`6956`)
636+
-
632637

633638
.. _whatsnew_1000.performance:
634639

pandas/core/arrays/categorical.py

-1
Original file line numberDiff line numberDiff line change
@@ -1676,7 +1676,6 @@ def to_dense(self):
16761676
"""
16771677
return np.asarray(self)
16781678

1679-
@deprecate_kwarg(old_arg_name="fill_value", new_arg_name="value")
16801679
def fillna(self, value=None, method=None, limit=None):
16811680
"""
16821681
Fill NA/NaN values using the specified method.

pandas/io/formats/console.py

-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ def get_console_size():
1313
from pandas import get_option
1414

1515
display_width = get_option("display.width")
16-
# deprecated.
1716
display_height = get_option("display.max_rows")
1817

1918
# Consider

pandas/plotting/_matplotlib/core.py

-10
Original file line numberDiff line numberDiff line change
@@ -195,16 +195,6 @@ def __init__(
195195
def _validate_color_args(self):
196196
import matplotlib.colors
197197

198-
if "color" not in self.kwds and "colors" in self.kwds:
199-
warnings.warn(
200-
(
201-
"'colors' is being deprecated. Please use 'color'"
202-
"instead of 'colors'"
203-
)
204-
)
205-
colors = self.kwds.pop("colors")
206-
self.kwds["color"] = colors
207-
208198
if (
209199
"color" in self.kwds
210200
and self.nseries == 1

pandas/plotting/_misc.py

-6
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
from contextlib import contextmanager
22

3-
from pandas.util._decorators import deprecate_kwarg
4-
53
from pandas.plotting._core import _get_plot_backend
64

75

@@ -210,7 +208,6 @@ def radviz(frame, class_column, ax=None, color=None, colormap=None, **kwds):
210208
)
211209

212210

213-
@deprecate_kwarg(old_arg_name="data", new_arg_name="frame")
214211
def andrews_curves(
215212
frame, class_column, ax=None, samples=200, color=None, colormap=None, **kwargs
216213
):
@@ -310,8 +307,6 @@ def bootstrap_plot(series, fig=None, size=50, samples=500, **kwds):
310307
)
311308

312309

313-
@deprecate_kwarg(old_arg_name="colors", new_arg_name="color")
314-
@deprecate_kwarg(old_arg_name="data", new_arg_name="frame", stacklevel=3)
315310
def parallel_coordinates(
316311
frame,
317312
class_column,
@@ -440,7 +435,6 @@ class _Options(dict):
440435

441436
def __init__(self, deprecated=False):
442437
self._deprecated = deprecated
443-
# self['xaxis.compat'] = False
444438
super().__setitem__("xaxis.compat", False)
445439

446440
def __getitem__(self, key):

pandas/tests/plotting/test_misc.py

-8
Original file line numberDiff line numberDiff line change
@@ -202,9 +202,6 @@ def test_andrews_curves(self, iris):
202202
handles, labels = ax.get_legend_handles_labels()
203203
self._check_colors(handles, linecolors=colors)
204204

205-
with tm.assert_produces_warning(FutureWarning):
206-
andrews_curves(data=df, class_column="Name")
207-
208205
@pytest.mark.slow
209206
def test_parallel_coordinates(self, iris):
210207
from pandas.plotting import parallel_coordinates
@@ -251,11 +248,6 @@ def test_parallel_coordinates(self, iris):
251248
handles, labels = ax.get_legend_handles_labels()
252249
self._check_colors(handles, linecolors=colors)
253250

254-
with tm.assert_produces_warning(FutureWarning):
255-
parallel_coordinates(data=df, class_column="Name")
256-
with tm.assert_produces_warning(FutureWarning):
257-
parallel_coordinates(df, "Name", colors=colors)
258-
259251
# not sure if this is indicative of a problem
260252
@pytest.mark.filterwarnings("ignore:Attempting to set:UserWarning")
261253
def test_parallel_coordinates_with_sorted_labels(self):

0 commit comments

Comments
 (0)