Skip to content

DEPR: enforce kwarg deprecations in plotting, Categorical.fillna #30190

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Dec 12, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions doc/source/whatsnew/v1.0.0.rst
Original file line number Diff line number Diff line change
Expand Up @@ -627,6 +627,11 @@ or ``matplotlib.Axes.plot``. See :ref:`plotting.formatters` for more.
- Changed the default value for ``ordered`` in :class:`CategoricalDtype` from ``None`` to ``False`` (:issue:`26336`)
- :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`)
-
- Removed the previously deprecated keyword "fill_value" from :meth:`Categorical.fillna`, use "value" instead (:issue:`19269`)
- Removed the previously deprecated keyword "data" from :func:`andrews_curves`, use "frame" instead (:issue:`6956`)
- Removed the previously deprecated keyword "data" from :func:`parallel_coordinates`, use "frame" instead (:issue:`6956`)
- Removed the previously deprecated keyword "colors" from :func:`parallel_coordinates`, use "color" instead (:issue:`6956`)
-

.. _whatsnew_1000.performance:

Expand Down
1 change: 0 additions & 1 deletion pandas/core/arrays/categorical.py
Original file line number Diff line number Diff line change
Expand Up @@ -1676,7 +1676,6 @@ def to_dense(self):
"""
return np.asarray(self)

@deprecate_kwarg(old_arg_name="fill_value", new_arg_name="value")
def fillna(self, value=None, method=None, limit=None):
"""
Fill NA/NaN values using the specified method.
Expand Down
1 change: 0 additions & 1 deletion pandas/io/formats/console.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ def get_console_size():
from pandas import get_option

display_width = get_option("display.width")
# deprecated.
display_height = get_option("display.max_rows")

# Consider
Expand Down
10 changes: 0 additions & 10 deletions pandas/plotting/_matplotlib/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -195,16 +195,6 @@ def __init__(
def _validate_color_args(self):
import matplotlib.colors

if "color" not in self.kwds and "colors" in self.kwds:
warnings.warn(
(
"'colors' is being deprecated. Please use 'color'"
"instead of 'colors'"
)
)
colors = self.kwds.pop("colors")
self.kwds["color"] = colors

if (
"color" in self.kwds
and self.nseries == 1
Expand Down
6 changes: 0 additions & 6 deletions pandas/plotting/_misc.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
from contextlib import contextmanager

from pandas.util._decorators import deprecate_kwarg

from pandas.plotting._core import _get_plot_backend


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


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


@deprecate_kwarg(old_arg_name="colors", new_arg_name="color")
@deprecate_kwarg(old_arg_name="data", new_arg_name="frame", stacklevel=3)
def parallel_coordinates(
frame,
class_column,
Expand Down Expand Up @@ -440,7 +435,6 @@ class _Options(dict):

def __init__(self, deprecated=False):
self._deprecated = deprecated
# self['xaxis.compat'] = False
super().__setitem__("xaxis.compat", False)

def __getitem__(self, key):
Expand Down
8 changes: 0 additions & 8 deletions pandas/tests/plotting/test_misc.py
Original file line number Diff line number Diff line change
Expand Up @@ -202,9 +202,6 @@ def test_andrews_curves(self, iris):
handles, labels = ax.get_legend_handles_labels()
self._check_colors(handles, linecolors=colors)

with tm.assert_produces_warning(FutureWarning):
andrews_curves(data=df, class_column="Name")

@pytest.mark.slow
def test_parallel_coordinates(self, iris):
from pandas.plotting import parallel_coordinates
Expand Down Expand Up @@ -251,11 +248,6 @@ def test_parallel_coordinates(self, iris):
handles, labels = ax.get_legend_handles_labels()
self._check_colors(handles, linecolors=colors)

with tm.assert_produces_warning(FutureWarning):
parallel_coordinates(data=df, class_column="Name")
with tm.assert_produces_warning(FutureWarning):
parallel_coordinates(df, "Name", colors=colors)

# not sure if this is indicative of a problem
@pytest.mark.filterwarnings("ignore:Attempting to set:UserWarning")
def test_parallel_coordinates_with_sorted_labels(self):
Expand Down