Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix traceback when displaying chart with invalid spec #565

Merged
merged 1 commit into from
Mar 12, 2018

Conversation

jakevdp
Copy link
Collaborator

@jakevdp jakevdp commented Mar 10, 2018

This addresses #480, with a workaround of the issue in ipython/ipython#11038

@ellisonbg – I'd appreciate your opinion on the approach I used here.

After this, the traceback in #480 looks like this:

import altair as alt
alt.Chart()
---------------------------------------------------------------------------
SchemaValidationError                     Traceback (most recent call last)
~/github/altair-viz/altair/altair/vegalite/v2/api.py in to_dict(self, *args, **kwargs)
    254         if dct is None:
    255             kwargs['validate'] = 'deep'
--> 256             dct = super(TopLevelMixin, copy).to_dict(*args, **kwargs)
    257 
    258         if is_top_level:

~/github/altair-viz/altair/altair/utils/schemapi.py in to_dict(self, validate, ignore, context)
    228                 self.validate(result)
    229             except jsonschema.ValidationError as err:
--> 230                 raise SchemaValidationError(self, err)
    231         return result
    232 

SchemaValidationError: Invalid specification

        altair.vegalite.v2.api.Chart, validating 'required'

        'mark' is a required property
        

@jakevdp
Copy link
Collaborator Author

jakevdp commented Mar 10, 2018

Sorry, another commit snuck in. I'll update the base branch

@jakevdp jakevdp changed the base branch from master to moredocs March 10, 2018 19:05
@jakevdp jakevdp changed the base branch from moredocs to master March 10, 2018 19:05
@ellisonbg
Copy link
Collaborator

This isn't ideal, but I think we should do this for now.

@jakevdp
Copy link
Collaborator Author

jakevdp commented Mar 12, 2018

I'm going to merge, with #568 open to track future fixes

@jakevdp jakevdp merged commit fd9d05b into vega:master Mar 12, 2018
@jakevdp jakevdp deleted the fix-render branch March 12, 2018 15:50
jakevdp added a commit that referenced this pull request Mar 12, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants