Skip to content

COMPAT: silence mpl_style warnings #12315

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

Closed
wants to merge 1 commit into from
Closed
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
6 changes: 5 additions & 1 deletion pandas/core/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,11 @@ def _set_option(*args, **kwargs):
root[k] = v

if o.cb:
o.cb(key)
if silent:
with warnings.catch_warnings(record=True):
o.cb(key)
else:
o.cb(key)


def _describe_option(pat='', _print_desc=True):
Expand Down
2 changes: 1 addition & 1 deletion pandas/core/config_init.py
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,7 @@

def mpl_style_cb(key):
warnings.warn(pc_mpl_style_deprecation_warning, FutureWarning,
stacklevel=4)
stacklevel=5)

import sys
from pandas.tools.plotting import mpl_stylesheet
Expand Down
3 changes: 2 additions & 1 deletion pandas/tests/test_categorical.py
Original file line number Diff line number Diff line change
Expand Up @@ -4109,7 +4109,8 @@ def test_str_accessor_api_for_categorical(self):
('decode', ("UTF-8",), {}),
('encode', ("UTF-8",), {}),
('endswith', ("a",), {}),
('extract', ("([a-z]*) ",), {}),
('extract', ("([a-z]*) ",), {"expand":False}),
('extract', ("([a-z]*) ",), {"expand":True}),
('extractall', ("([a-z]*) ",), {}),
('find', ("a",), {}),
('findall', ("a",), {}),
Expand Down