Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Patten matching callbacks do not warn if no matches exist #3007

Open
farhanhubble opened this issue Sep 19, 2024 · 0 comments
Open

Patten matching callbacks do not warn if no matches exist #3007

farhanhubble opened this issue Sep 19, 2024 · 0 comments
Assignees
Labels
bug something broken P3 not needed for current cycle

Comments

@farhanhubble
Copy link

Describe your context
Please provide us your environment, so we can easily reproduce the issue.

  • replace the result of pip list | grep dash below
dash                                     2.18.1         A Python framework ...
dash-bootstrap-components                1.6.0          Bootstrap themed co...
dash-core-components                     2.0.0          Core component suit...
dash-html-components                     2.0.0          Vanilla HTML compon...
dash-table                               5.0.0          Dash table

Describe the bug

When registering a pattern-matching callback, no warning is issued if the pattern does not match the ID of any of the DOM elements.
For example if we create a button with an ID like this:

id={
	"type": "delete-list-item",
	"deletion-target": "some_path",
        "extras":  "..."
}

and then define a callback that only defines 2/3 of the keys present in the id dict:

@app.callback(
    Input(
        {"type": "delete-list-item", "deletion-target": "some_path", }, "n_clicks"
    ),
)
def delete_list_item(n_clicks):
    print(n_clicks)

The callback does not get attached to any element but does show up on the dev tools page.

Expected behavior

Under the default conditions (app.config.suppress_callback_exceptions = False), a warning should be emitted when no matching ids are found.

Screenshots

Not needed

@farhanhubble farhanhubble changed the title [BUG]Patten matching callbacks do not warn on missing ID key [BUG]Patten matching callbacks do not warn if no matches exist Sep 19, 2024
@gvwilson gvwilson changed the title [BUG]Patten matching callbacks do not warn if no matches exist Patten matching callbacks do not warn if no matches exist Sep 23, 2024
@gvwilson gvwilson added bug something broken P3 not needed for current cycle labels Sep 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug something broken P3 not needed for current cycle
Projects
None yet
Development

No branches or pull requests

3 participants