diff --git a/plotly/plotly/plotly.py b/plotly/plotly/plotly.py index bc7c45a2161..f1c1fdc3e90 100644 --- a/plotly/plotly/plotly.py +++ b/plotly/plotly/plotly.py @@ -576,17 +576,6 @@ def write(self, trace, layout=None, validate=True, "to 'your_stream.write()'. Here's why the object is " "invalid:\n\n{1}".format(stream_object['type'], err) ) - try: - tools.validate_stream(stream_object, stream_object['type']) - except exceptions.PlotlyError as err: - raise exceptions.PlotlyError( - "Part of the data object with type, '{0}', cannot yet be " - "streamed into Plotly. If you do not want to validate " - "your data objects when streaming, you can set " - "'validate=False' in the call to 'your_stream.write()'. " - "Here's why the object cannot be streamed:\n\n{1}" - .format(stream_object['type'], err) - ) if layout is not None: try: tools.validate(layout, 'Layout') diff --git a/plotly/tests/test_core/test_stream/test_stream.py b/plotly/tests/test_core/test_stream/test_stream.py index 7e65b3d8e94..19a5db9f8e4 100644 --- a/plotly/tests/test_core/test_stream/test_stream.py +++ b/plotly/tests/test_core/test_stream/test_stream.py @@ -102,8 +102,10 @@ def test_stream_validate_layout(): my_stream.close() -@raises(exceptions.PlotlyError) def test_stream_unstreamable(): + + # even though `name` isn't streamable, we don't validate it --> should pass + py.sign_in(un, ak) my_stream = py.Stream(tk) my_stream.open() diff --git a/plotly/tools.py b/plotly/tools.py index dc51a0a9ac5..018d1442253 100644 --- a/plotly/tools.py +++ b/plotly/tools.py @@ -1328,41 +1328,6 @@ def validate(obj, obj_type): format(obj_type)) -def validate_stream(obj, obj_type): - """Validate a data dictionary (only) for use with streaming. - - An error is raised if a key within (or nested within) is not streamable. - - """ - try: - obj_type = graph_objs.KEY_TO_NAME[obj_type] - except KeyError: - pass - info = graph_objs.INFO[graph_objs.NAME_TO_KEY[obj_type]] - for key, val in list(obj.items()): - if key == 'type': - continue - if 'streamable' in info['keymeta'][key].keys(): - if not info['keymeta'][key]['streamable']: - raise exceptions.PlotlyError( - "The '{0}' key is not streamable in the '{1}' " - "object".format( - key, obj_type - ) - ) - else: - raise exceptions.PlotlyError( - "The '{0}' key is not streamable in the '{1}' object".format( - key, obj_type - ) - ) - try: - sub_obj_type = graph_objs.KEY_TO_NAME[key] - validate_stream(val, sub_obj_type) - except KeyError: - pass - - def _replace_newline(obj): """Replaces '\n' with '
' for all strings in a collection.""" if isinstance(obj, dict):