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

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

Open
joelostblom opened this issue Feb 21, 2023 · 0 comments
Open

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

joelostblom opened this issue Feb 21, 2023 · 0 comments

Comments

@joelostblom
Copy link
Contributor

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
Projects
None yet
Development

No branches or pull requests

1 participant