Skip to content

Commit

Permalink
Fix deprecation warning for go.Annotations. (#1138)
Browse files Browse the repository at this point in the history
There is no go.layout.Annotations (it should not have been plural)
  • Loading branch information
jonmmease authored Aug 29, 2018
1 parent d8095de commit 091f4c1
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
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

0 comments on commit 091f4c1

Please sign in to comment.