Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork2.2k
Open
Description
Describe your context
dash 3.2.0dash-bootstrap-components 2.0.4dash-extensions 2.0.4dash-svg 0.0.12Describe the bug
Passing a list-of-dict can be passed tooptions ofdcc.Dropdown but is not allowed by the types:
error:Argument "options" to "Dropdown" has incompatible type "list[dict[str, str]]"; expected "Sequence[str | SupportsFloat | SupportsInt | SupportsComplex | bool] | dict[Any, Any] | Sequence[Options] | None" [arg-type]Found 1 error in 1 file (checked 1 source file)
Expected behavior
AllowSequence[dict[...]]
MVCE
# dropdown_tying.pyfromdashimportDash,dcc,html,Input,Output,callbackoptions= [ {'label':'New York City','value':'NYC'}, {'label':'Montreal','value':'MON'}, {'label':'San Francisco','value':'SF'}, ]app=Dash()app.layout=html.Div([dcc.Dropdown(options=options,value='NYC',id='demo-dropdown'),html.Div(id='dd-output-container')])@callback(Output('dd-output-container','children'),Input('demo-dropdown','value'))defupdate_output(value):returnf'You have selected{value}'if__name__=='__main__':app.run(debug=True)
mypy dropdown_tying.py