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

[BUG] Background callbacks - Error with Pattern Matching in Running option #2499

Closed
slyin87 opened this issue Apr 7, 2023 · 4 comments
Closed

Comments

@slyin87
Copy link

slyin87 commented Apr 7, 2023

Describe your context
I use background callback with Celery + Redis. In the example there is a running option to put in the components. The thing is I am using pattern matching. If I remove the running option, there is no problem.

This is my app.py:
image

This is my callback:
image

dash                      2.9.0
dash-bootstrap-components 1.4.1
dash-core-components      2.0.0
dash-html-components      2.0.0
dash-mantine-components   0.12.0
dash-table                5.0.0

Describe the bug

the running option using background callback does not work. Moreover, Why do I see it is a long callback instead of background callback?
Error:

File "/usr/local/lib/python3.10/site-packages/dash/_callback.py", line 167, in callback
    validate_long_inputs(x[0] for x in long_spec["running"])
  File "/usr/local/lib/python3.10/site-packages/dash/_callback.py", line 209, in validate_long_inputs
    raise WildcardInLongCallback(
dash.exceptions.WildcardInLongCallback: long callbacks does not support dependencies with
pattern-matching ids
    Received: <Output `{"index":["MATCH"],"type":"main_apm_generate_boxplot_button"}.disabled`>
@Ciaran-YouSeq
Copy link

i'm having the same issue with DiskcacheManager in dash 2.9.2. I'm a bit confused by this error as the docs (https://dash.plotly.com/background-callbacks) say pattern matching is supported for background callbacks, but in the validate_long_inputs method in _callback.py there is no mechanism that allows pattern matching - it will always raise WildcardInLongCallback

@T4rk1n
Copy link
Contributor

T4rk1n commented Apr 12, 2023

Pattern matching is supported for inputs and outputs but it was not implemented for progress, running and cancel.
#2111

@nickmelnikov82
Copy link
Member

Hi, your situation is interesting and I found 3 similar errors that might be useful for you:

  1. Possible bug with callbacks
  2. Callback executes but return value has no effect
  3. Pattern-matching callbacks with empty or partly-empty Output

@T4rk1n
Copy link
Contributor

T4rk1n commented Mar 28, 2024

Duplicate of #2111

@T4rk1n T4rk1n marked this as a duplicate of #2111 Mar 28, 2024
@T4rk1n T4rk1n closed this as completed Mar 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants