You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
I have callbacks I wish to start on load (prevent_initial_call=False) and do not care about the order of results eg. loading data and then sending dmc notification.
These are either from the same page or different pages targeting the same output. Having the ability to send from different pages helps the consistency app as the user sees notifications persist between pages.
Setting prevent_initial_call="initial_duplicate" and allow_duplicate=True results in effectively prevent_initial_Call=True. If only set to on some of the duplicate results in the following error, which says to do the thing I am already doing.
dash.exceptions.DuplicateCallback: allow_duplicate requires prevent_initial_call to be True. The order of the call is not guaranteed to be the same on every page load. To enable duplicate callback with initial call, set prevent_initial_call='initial_duplicate' or globally in the config prevent_initial_callbacks='initial_duplicate'
I also tried setting this at the global level but results in:
TypeError: Dash() got an unexpected keyword argument 'prevent_initial_callback'
Perhaps I am misunderstanding the purpose but I just want to run the callbacks with full awareness that the order is not guaranteed (desirable in this case).
The text was updated successfully, but these errors were encountered:
gvwilson
changed the title
[BUG] prevent_initial_call="initial_duplicate" not working as expectedprevent_initial_call="initial_duplicate" not working as expected
Sep 3, 2024
Hello!
Describe the bug
I have callbacks I wish to start on load (prevent_initial_call=False) and do not care about the order of results eg. loading data and then sending dmc notification.
These are either from the same page or different pages targeting the same output. Having the ability to send from different pages helps the consistency app as the user sees notifications persist between pages.
Setting
prevent_initial_call="initial_duplicate"
andallow_duplicate=True
results in effectivelyprevent_initial_Call=True
. If only set to on some of the duplicate results in the following error, which says to do the thing I am already doing.dash.exceptions.DuplicateCallback: allow_duplicate requires prevent_initial_call to be True. The order of the call is not guaranteed to be the same on every page load. To enable duplicate callback with initial call, set prevent_initial_call='initial_duplicate' or globally in the config prevent_initial_callbacks='initial_duplicate'
I also tried setting this at the global level but results in:
TypeError: Dash() got an unexpected keyword argument 'prevent_initial_callback'
Perhaps I am misunderstanding the purpose but I just want to run the callbacks with full awareness that the order is not guaranteed (desirable in this case).
The only documentation I could find is https://community.plotly.com/t/dash-2-9-2-released-partial-property-updates-with-patch-duplicate-outputs-dcc-geolocation-scatter-group-attributes-and-more/72114#allowing-duplicate-callback-outputs-7
I've attached an MRE here https://github.com/Lxstr/dash-multi-page-app-demos/tree/prevent-initial-duplicate
Thanks!
The text was updated successfully, but these errors were encountered: