Uh oh!
There was an error while loading. Please reload this page.
Validate component properties #264 - March 1 - #452
Conversation
rmarren1
commented
Nov 8, 2018
T4rk1n
commented
Nov 8, 2018
Thanks, I'll have a good look on friday review party. |
| mimetype='application/json' | ||
| ) | ||
| self.callback_map[callback_id]['func'] = func |
There was a problem hiding this comment.
Why do that in two difference part ? Couldn't your additions in dispatch be in add_context ?
There was a problem hiding this comment.
We would have to pass namespace, component_id, component_property, to this since that info is available in dispatch. I originally thought this might clash with the other arguments (e.g. if you had a property called namespace) although I now think this would be fine, but it might make it difficult if we want to support passing props with keyword arguments in the future.
rmarren1
commented
Nov 25, 2018
For the |
Updates:
Bumped all release candidates. |
rmarren1
commented
Dec 4, 2018
Tested the RCs with dash-docs, and a few Dash apps I have built. |
rmarren1
commented
Dec 18, 2018
|
Testing the demo with the rc version I got a figure validation error and the message:
Is it |
T4rk1n
commented
Dec 28, 2018
Shouldn't |
T4rk1n
commented
Dec 28, 2018
I think the graph now put a random id if there's none. |
chubukov
commented
Jan 11, 2019
Wanted to note that the issue I raised in the other thread still exists. Numerical types in checklist values and dropdown values (and probably other components too) still raise errors with the latest release. |
rmarren1
commented
Feb 21, 2019
Updated top level comment, the correct way to turn off validation is by setting |
chriddyp
commented
Apr 19, 2019
This was a really great effort and was in line to be a PR of the Year 🏆 . In the end, with the addition of alternative language backends for Dash (DashR), we decided to double down on the Dash Dev Tools UI and invest & maintain the validation code in the front-end. |
Note: This PR is a continuation of #340. That PR had ~80 comments (most were outdated and no longer relevant), and 96 commits. This PR is the same code, just more readable.
PR for #264
Current Prerelease
Validation is on by default. To turn it off, you can set
app.config.suppress_validation_exceptions = TrueTest Cases to run for demo
Example Error Messages
PropTypes to Cerberus reference
array{'type': 'list'}bool{'type': 'boolean'}func{}object{'type': 'dict'}dictobject. We cannot be more general (e.g.collections.abc.Mapping) since the coreComponentis an instance of that.string{'type': 'string'}symbol{}node{'anyof': [{'type': 'component'}, {'type': 'boolean'}, {'type': 'number'}, {'type': 'string'}, {'type': 'list', 'schema': {'anyof': [{'type': 'component'}, {'type': 'boolean'}, {'type': 'number'}, {'type': 'string'}]}}]}instanceOf(Object){}oneOf(['val1', 2]){'allowed': [None, 'val1', 2]}'characters stripped off each end. This is becausemetadata.jsongeneration serializes the literal values as json, so for examplePropTypes.oneOf(['News', 'Photos'])serializes to["'News'", "'Photos'"]. reactjs/react-docgen#57oneOfType( [ PropTypes.string, PropTypes.bool ] ){'anyof': [{'type': 'string', 'type': 'boolean'}]}PropTypethat cannot be validated individually (e.g.PropType.func), no validation will occur and the schema will effectively be{}arrayOf( PropTypes.number ){'type': 'list', 'schema': {'type': 'number'}}objectOf( PropTypes.number ){'type': 'dict', 'valueschema': {'type': 'number'}}shape( { k1: PropTypes.string, k2: PropTypes.number } ){'type': 'dict', 'allow_unknown': False, 'schema': {'k1': {'type': 'string}, 'k2': {'type': 'number'}}}any{'type': ('boolean', 'number', 'string', 'dict', 'list')}