Skip to content

FIX: fix incorrect import in deprecation warning for Scene class #1670

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 2 commits into from
Aug 31, 2019

Conversation

stevenjkern
Copy link
Contributor

I noticed a minor issue in the text of a deprecation warning on the Scene class the other day, where the recommended fully-qualified class name is the same as the one being used:

In [1]: from plotly.graph_objs import Scene

In [2]: Scene()
/Users/skern/.edm/envs/mb_test_plotly3/lib/python3.6/site-packages/plotly/graph_objs/_deprecations.py:477: DeprecationWarning:

plotly.graph_objs.Scene is deprecated.
Please replace it with one of the following more specific types
  - plotly.graph_objs.Scene

The correct class that should be recommended is plotly.graph_objs.layout.Scene. This PR just corrects the few occurrences of that.

@jonmmease
Copy link
Contributor

Hi @stevenjkern,
Thanks for pointing this out! The files that you modified here are automatically generated during the code generation process, so we we'll need to make these changes in the code generation logic so that they are not overwritten when plotly.js is updated. You'll need to update this line in the code generation logic:

"Scene": {"base_type": dict, "new": ["Scene"]},

to replace "new": ["Scene"] with "new": ["layout"] and then rerun code generation with

$ pip install black  # If you don't have black installed yet
$ python setup.py codegen

Thanks!

@jonmmease
Copy link
Contributor

I added the codegen logic. Thanks again for pointing this out @stevenjkern!

@jonmmease jonmmease merged commit 2c3114e into plotly:master Aug 31, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants