Skip to content

[BUG] Patch += operation not working on the patch object. #2855

Closed
@T4rk1n

Description

@T4rk1n

If you have a patch object for a number prop and try to do patched += 1, the callback will fail with an error, returned non serializable object.

Example:

app = Dash()
app.layout = [dcc.Store(data=0, store="store"), html.Button("click", id="click")]
@app.callback(Output("store", "data"), Input("click", "n_clicks"))
def on_click(_):
    patched = Patch()
    patched += 1
    return patched

Clicking on the button result in the error, it should instead update the store data prop to +1.

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