Skip to content
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

Fix deprecation warning for go.Annotations. #1138

Merged
merged 1 commit into from
Aug 29, 2018
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
2 changes: 1 addition & 1 deletion codegen/compatibility.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
'new': ['Scatter', 'Bar', 'Area', 'Histogram', 'etc.']},
'Annotations':
{'base_type': list,
'new': ['layout', 'layout.scene']},
'new': ['layout.Annotation', 'layout.scene.Annotation']},
'Frames':
{'base_type': list,
'new': ['Frame']},
Expand Down
12 changes: 6 additions & 6 deletions plotly/graph_objs/_deprecations.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,24 +45,24 @@ class Annotations(list):
"""
plotly.graph_objs.Annotations is deprecated.
Please replace it with a list or tuple of instances of the following types
- plotly.graph_objs.layout.Annotations
- plotly.graph_objs.layout.scene.Annotations
- plotly.graph_objs.layout.Annotation
- plotly.graph_objs.layout.scene.Annotation

"""

def __init__(self, *args, **kwargs):
"""
plotly.graph_objs.Annotations is deprecated.
Please replace it with a list or tuple of instances of the following types
- plotly.graph_objs.layout.Annotations
- plotly.graph_objs.layout.scene.Annotations
- plotly.graph_objs.layout.Annotation
- plotly.graph_objs.layout.scene.Annotation

"""
warnings.warn(
"""plotly.graph_objs.Annotations is deprecated.
Please replace it with a list or tuple of instances of the following types
- plotly.graph_objs.layout.Annotations
- plotly.graph_objs.layout.scene.Annotations
- plotly.graph_objs.layout.Annotation
- plotly.graph_objs.layout.scene.Annotation
""", DeprecationWarning
)
super(Annotations, self).__init__(*args, **kwargs)
Expand Down