run() add new parameter hide_all_callbacks#3564
Conversation
dash/_callback.py
Outdated
| config_prevent_initial_callbacks = _kwargs.pop( | ||
| "config_prevent_initial_callbacks", False | ||
| ) | ||
| config_hide_all_callbacks = _kwargs.pop("config_hide_all_callbacks", False) |
There was a problem hiding this comment.
How are those actually insert when using @callback directly? I think we need a better system for those since we want the same behavior for both @app.callback and @callback.
Think you can refactor these config into a context and use the context instead of passing them around?
There was a problem hiding this comment.
How are those actually insert when using
@callbackdirectly? I think we need a better system for those since we want the same behavior for both@app.callbackand@callback.Think you can refactor these config into a context and use the context instead of passing them around?
Yes, similarly, for prevent_initial_callbacks, the callback functions defined by dash.callback() cannot obtain the setting values from dash.Dash() too.
…config_hide_all_callbacks in _callback.callback()
dash/_callback.py
Outdated
| config_prevent_initial_callbacks = _kwargs.pop( | ||
| "config_prevent_initial_callbacks", False | ||
| # Get prevent_initial_callbacks and hide_all_callbacks from get_app().config | ||
| current_app_config = get_app().config |
There was a problem hiding this comment.
Nice usage of get_app, but this will not work if the app hasn't been instanced yet which we can't guarantee with dash.callback.
We can defer it all and map the configs values in the _setup_server after this line:
Line 1648 in a9a173f
…ch callback function through the hide_all_callbacks parameter
|
Because this is primarily used for debugging, would it make more sense to put this into the |
This is indeed more in line with the purpose of development and debugging. I'll look into how to refactor it. |


For the scenario corresponding to #3493, add a new parameter
hide_all_callbackstoDash(), which is used to change the default application value of thehiddenparameter inapp.callback(), improving the convenience of callback debugging for complex applications. Example: