plotly.py: jsonschema.SchemaError when a figure is validated

Here is a minimal example that reproduces the bug: http://nbviewer.jupyter.org/gist/empet/cf922d7c7f4269d6f63432ec67a5d020

The notebook runs OK (with plotly 2.0.1) when I call plot(fig). iplot(fig) generates the plot too, but an error box pops up whenever Jupyter tries to save the notebook. The box has the following content:

The save operation succeeded, but the notebook does not appear to be valid. The validation error was: Notebook Validation failed: u'data': [{u'colorscale': u'Viridis', u'z': [[2, 27, 105, 100], [87, 14, 121, 102], [26, 121, 73, 34], [44, 105, 111, 127]], u'type': u'heatmap', u'zsmooth': u'best'}], u'layout': {u'width': 400, u'height': 400}} is not valid under any of the given schemas:

{ "data": [ { "colorscale": "Viridis", "z": [ [ 2, 27, 105, 100 ], [ 87, 14, 121, 102 ], [ 26, 121, 73, 34 ], [ 44, 105, 111, 127 ] ], "type": "heatmap", "zsmooth": "best" } ], "layout": { "width": 400, "height": 400 } }

Initially I formulated this issue only for heatmaps, but meanwhile I realized that this behaviour manifests for any type of plot.

About this issue

  • Original URL
  • State: closed
  • Created 7 years ago
  • Reactions: 4
  • Comments: 15 (4 by maintainers)

Commits related to this issue

Most upvoted comments

Hi I updated nbformat to 4.3.0 and it still raises the same “validation failed” issue…

I’m running this locally on my mac, and am still seeing the issue after updating nbformat. Any ideas?

I’ve updated nbformat (to 4.2.0) and am still seeing this issue.

@malindho @antvig I upgrade my jupyter at the same time and the problem is solved: pip install --upgrade jupyter