Skip to content

Validate plot backend when setting. #28164

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 10 commits into from
Sep 3, 2019

Conversation

TomAugspurger
Copy link
Contributor

In [1]: import pandas as pd

In [2]: import sys

In [3]: import types

In [4]: module = types.ModuleType("foo")

In [5]: sys.modules['foo'] = module

In [6]: pd.set_option('plotting.backend', 'foo')
---------------------------------------------------------------------------
ValueError                                Traceback (most recent call last)
<ipython-input-6-123b6513deb2> in <module>
----> 1 pd.set_option('plotting.backend', 'foo')

...

~/sandbox/pandas/pandas/plotting/_core.py in _find_backend(backend)
   1588         "top-level `.plot` method."
   1589     )
-> 1590     raise ValueError(msg.format(name=backend))
   1591
   1592

ValueError: Could not find plotting backend 'foo'. Ensure that you've installed the package providing the 'foo' entrypoint, or that the package has atop-level `.plot` method.

Closes #28163

```python
In [1]: import pandas as pd

In [2]: import sys

In [3]: import types

In [4]: module = types.ModuleType("foo")

In [5]: sys.modules['foo'] = module

In [6]: pd.set_option('plotting.backend', 'foo')
---------------------------------------------------------------------------
ValueError                                Traceback (most recent call last)
<ipython-input-6-123b6513deb2> in <module>
----> 1 pd.set_option('plotting.backend', 'foo')

...

~/sandbox/pandas/pandas/plotting/_core.py in _find_backend(backend)
   1588         "top-level `.plot` method."
   1589     )
-> 1590     raise ValueError(msg.format(name=backend))
   1591
   1592

ValueError: Could not find plotting backend 'foo'. Ensure that you've installed the package providing the 'foo' entrypoint, or that the package has atop-level `.plot` method.

```

Closes pandas-dev#28163
@WillAyd WillAyd added the Visualization plotting label Aug 28, 2019
@WillAyd WillAyd added this to the 1.0 milestone Aug 28, 2019
@TomAugspurger
Copy link
Contributor Author

cc @datapythonista

Copy link
Member

@datapythonista datapythonista left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm, thanks for the fix

@TomAugspurger
Copy link
Contributor Author

Merging later today if there aren't any objections.

@jbrockmendel
Copy link
Member

LGTM

@TomAugspurger TomAugspurger merged commit efa177d into pandas-dev:master Sep 3, 2019
@TomAugspurger TomAugspurger deleted the 28163-validation branch September 3, 2019 19:01
proost pushed a commit to proost/pandas that referenced this pull request Dec 19, 2019
proost pushed a commit to proost/pandas that referenced this pull request Dec 19, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Setting the plot backend should validate .plot immediately
4 participants