Skip to content

[BUG] Unsupported format string passed to Button.__format__ #1024

@ghost

Description

Context

dash                 1.6.0
dash-core-components 1.5.0
dash-html-components 1.0.1
dash-renderer        1.2.0
dash-table           4.5.0
dash-daq                  0.2.1
dash-bootstrap-components 0.7.2

Bug description

When I run my application, I receive following error :

Traceback (most recent call last):
File "app.py", line 452, in
@app.callback(
File "C:\Users\user\AppData\Local\Programs\Python\Python38\lib\site-packages\dash\dash.py", line 1264, in callback
self._validate_callback(output, inputs, state)
File "C:\Users\user\AppData\Local\Programs\Python\Python38\lib\site-packages\dash\dash.py", line 921, in _validate_callback
if arg_id not in layout and arg_id != layout_id:
File "C:\Users\user\AppData\Local\Programs\Python\Python38\lib\site-packages\dash\development\base_component.py", line 257, in iter
for t in self._traverse():
File "C:\Users\user\AppData\Local\Programs\Python\Python38\lib\site-packages\dash\development\base_component.py", line 217, in _traverse
for t in self._traverse_with_paths():
File "C:\Users\user\AppData\Local\Programs\Python\Python38\lib\site-packages\dash\development\base_component.py", line 252, in _traverse_with_paths
for p, t in i._traverse_with_paths():
File "C:\Users\user\AppData\Local\Programs\Python\Python38\lib\site-packages\dash\development\base_component.py", line 244, in _traverse_with_paths
"(id={:s})".format(i.id)
TypeError: unsupported format string passed to Button.format

The error appear on a line where I define this callback :

@app.callback(
    Output('reportPid', 'data'),
    [Input('report1Button', 'n_clicks')],
    [State('pid1', 'data')]
)
def report1(n, data):
    return data

The error seems to be about naming of one of my button.

The weird thing is, if I remove this callback, no error.
I must be doing something wrong in this callback but I cannot see what, and the error is not helpful...

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions