You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I would expect the Dash app that follows to throw an error when the dcc.Input component tries to set children={"a dict": "is not allowed for children-input"}.
However, the error is only thrown when the html.Div component attempts to do the same.
importdashimportdash_html_componentsashtmlimportdash_core_componentsasdccapp=dash.Dash(__name__)
app.layout=html.Div([
dcc.Input(children={"a dict": "is not allowed for children-input"}),
html.Div(children={"a dict": "is not allowed for children-div"})
])
if__name__=='__main__':
app.run_server(debug=True)
Error:
An object was provided as `children` instead of a component, string, or number (or list of those). Check the children property that looks something like:
{
"a dict": "is not allowed for children-div"
}
The text was updated successfully, but these errors were encountered:
I think it is a little more right raise unexpected keyword argument: children error .
The reason seems to be that the __init__ function was called with children missing from args in the generated file.
dash/development/base_component.py (134-141)
ifnotk_in_propnamesandnotk_in_wildcards:
allowed_args=", ".join(
sorted(self._prop_names)
) # pylint: disable=no-memberraiseTypeError(
f"{error_string_prefix} received an unexpected keyword argument: `{k}`"f"\nAllowed arguments: {allowed_args}"
)
Input.py
args= {k: _locals[k] forkin_explicit_argsifk!="children"}
forkin []:
ifknotinargs:
raiseTypeError("Required argument `"+k+"` was not specified.")
super(Input, self).__init__(**args)
Link.py
args= {k: _locals[k] forkin_explicit_argsifk!="children"}
forkin ["href"]:
ifknotinargs:
raiseTypeError("Required argument `"+k+"` was not specified.")
super(Link, self).__init__(children=children, **args)
Is there a reason for separately pass children?
If put children in args together, the validation will be the same.
moved from https://github.com/plotly/dash-core/issues/214
@alexcjohnson
I would expect the Dash app that follows to throw an error when the
dcc.Input
component tries to setchildren={"a dict": "is not allowed for children-input"}
.However, the error is only thrown when the
html.Div
component attempts to do the same.Error:
The text was updated successfully, but these errors were encountered: