Make SchemaValidationError
more helpful by printing expected parameters
#2565
Labels
SchemaValidationError
more helpful by printing expected parameters
#2565
When a non-existing parameter name is used, I think it would be helpful to include the existing parameter names in the error message. For example, when misspelling a parameter name like in the example below it is not immediately clear whether I made a typo or something else went wrong, so the immediate feedback of seeing the correct parameter names would be helpful.
I also belive the error message text could be clarified a little. Especially for novices, I don't think it is immediately clear what it means that "Additional properties are not allowed" and it could helpful to update this error message to something like:
We can use the
inspect
module to retrieve the list of expected parameter names vialist(inspect.signature(altair.vegalite.v4.schema.core.Scale).parameters.keys())
. I can try to PR this if it sounds like a good idea (it looks like modifying the returned value of altair/utils/schemapi.py is the right place?).The text was updated successfully, but these errors were encountered: