Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit a445a6f

Browse files
committed
Remove Legacy graph_objs validate function
1 parent e22f2b6 commit a445a6f

File tree

1 file changed

+0
-25
lines changed

1 file changed

+0
-25
lines changed

plotly-package/plotly/tools.py

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -485,31 +485,6 @@ def get_graph_obj(obj, obj_type=None):
485485
return cls(obj)
486486

487487

488-
def validate(obj, obj_type):
489-
"""Validate a dictionary, list, or graph object as 'obj_type'.
490-
491-
This will not alter the 'obj' referenced in the call signature. It will
492-
raise an error if the 'obj' reference could not be instantiated as a
493-
valid 'obj_type' graph object.
494-
495-
"""
496-
# TODO: Deprecate or move. #283
497-
from plotly import graph_reference
498-
from plotly.graph_objs import graph_objs
499-
500-
if obj_type not in graph_reference.CLASSES:
501-
obj_type = graph_reference.string_to_class_name(obj_type)
502-
503-
try:
504-
cls = getattr(graph_objs, obj_type)
505-
#except AttributeError:
506-
except ValueError:
507-
raise exceptions.PlotlyError(
508-
"'{0}' is not a recognizable graph_obj.".
509-
format(obj_type))
510-
cls(obj) # this will raise on invalid keys/items
511-
512-
513488
def _replace_newline(obj):
514489
"""Replaces '\n' with '<br>' for all strings in a collection."""
515490
if isinstance(obj, dict):

0 commit comments

Comments
 (0)