Skip to content

Show python types instead of javascript types in error messages #2914

Open

Description

Originally mentioned in #2842 (comment).

Currently data types in the error messages are javascript rather than python. For example an error message could look like this:

alt.Chart(data.barley()).mark_bar().encode(
    x=alt.X('variety'),
    y=alt.Y('sum(yield)', stack='null'),  # should be eg. stack=None
)
'null' is not one of ['zero', 'center', 'normalize']
'null' is not of type 'null'
'null' is not of type 'boolean'

A would probably be more useful if the ever measured message look like this:

'null' is not one of ['zero', 'center', 'normalize']
'null' is not of type NoneType
'null' is not of type Bool

Or even simplifying the NoneType further:

'null' is not one of ['zero', 'center', 'normalize']
'null' is not of type Bool
'null' is not None

There is a [dictionary in the code]( and #2842 (comment).) for conversion between javascript and python types that could be useful here, but we might need to create something new as well

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions