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
it would be helpful to be able to access or call update_graphunwrapped. Currently, if you call update_graph, you'll call the wrapped version.
Three use cases:
Ability to unit test update_graph
Ability to call update_graph in e.g. Jupyter
Ability to call update_graph in other programs
I believe this violates how decorators work, so we might have to expose some method on the function like .inner so the caller would call e.g. update_graph.inner(value)
The text was updated successfully, but these errors were encountered:
Actually we don't do anything with the return value of the decorator right now - internal to the decorator we add the wrapped function to the callback map:
I suspect if instead we just return func everyone will be happy 🤞 (aside from any of our own tests that use the wrapped function - those will have to reference app.callback_map instead)
Just dropping a note a couple years later for others that might land here:
We were actually expecting that we'd have to do myfunc.__wrapped__ in our unit tests type work. But since the current dash.callback code returns the original func (instead of the wrapped version it created), you can just work directly with the function as-if it wasn't decorated with dash.callback().
i.e.
it would be helpful to be able to access or call
update_graph
unwrapped. Currently, if you callupdate_graph
, you'll call the wrapped version.Three use cases:
update_graph
update_graph
in e.g. Jupyterupdate_graph
in other programsI believe this violates how decorators work, so we might have to expose some method on the function like
.inner
so the caller would call e.g.update_graph.inner(value)
The text was updated successfully, but these errors were encountered: