question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

jsonschema.SchemaError when a figure is validated

See original GitHub issue

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.

Issue Analytics

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

github_iconTop GitHub Comments

5reactions
malindhocommented, Feb 28, 2017

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

4reactions
antvigcommented, Oct 24, 2017

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

Read more comments on GitHub >

github_iconTop Results From Across the Web

Handling Validation Errors - python-jsonschema
A validation error which this error is the context of. None if there wasn't one. In case an invalid schema itself is encountered,...
Read more >
python - jsonschema.validate() not validating type from schema
Your schema is not a valid schema. You need to declare these as properties and you are using required wrong (unless you are...
Read more >
Python: JSON schema validation - techtutorialsx
In this tutorial we will learn how to perform JSON schema validations using Python and the jsonschema module.
Read more >
A Vocabulary for Structural Validation of JSON - JSON Schema
An instance to validate may contain a string value with this character, regardless of the ability of the underlying programming language to deal ......
Read more >
Python Examples of jsonschema.ValidationError
def validate(self, *args, **kwargs): try: self.validator.validate(*args, **kwargs) except jsonschema.ValidationError as ex: if len(ex.path) > 0: if ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found