I’m experiencing an off issue when using the now-not-so-new Flexible Callback Signature feature of Dash 2.x.
Here is my code:
@app.callback(
output=[Output("test", "children")],
inputs={ 'a': Input('control-complexity-slider', 'value') }
)
def display(all_inputs):
return [all_inputs]
This returns the following error:
Callback error updating ..test.children..
TypeError: display() got an unexpected keyword argument 'a'
Whereas the following works:
@app.callback(
output=[Output("test", "children")],
inputs=[ Input('control-complexity-slider', 'value') ]
)
def display(all_inputs):
return [all_inputs]
I’m not quite sure how my first snippet differs from the documentation at Flexible Callback Signatures | Dash for Python Documentation | Plotly
@app.callback(
output=[Output(...), Output(...)],
inputs=dict(
ab=(Input(...), Input(...)),
c=Input(...)
)
)
def callback(ab, c):
a, b = ab
return [a + b, b + c]