-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
A proposed alternative to "suppress_callback_exception" #354
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
Comments
In principle I like this but I'm not sure technically how it would (i.e. how would we know that a callback isn't firing). Could you walk through a couple of simple examples that demonstrate cases where callbacks wouldn't fire but we could provide better error messages? |
|
For me, the point that @rmarren1 makes in issue 57 hits the nail on the head: "[suppressing] puts you in debugging hell for large applications". Apologies for missing this link. I will try update my renderer and see if this helps first. If this doesn't help, happy to make another example of where it can go wrong and what could be useful in its place. I agree with you guys where you suggest in another thread that better exception reporting is a cheap but effective solution here, rather than channeling info through javascript back to the console. |
@chriddyp shall i close the issue and move to another thread? |
That error information will be more visible in the future after plotly/dash-renderer#64 is worked through, which should functionally give you the same information as if exceptions were not suppressed. |
This actually excites me 😃. I updated my renderer to 13.1 - still some issues but can see theres a lot of work that you're done already to address this . I think adding other exceptions to callbacks checks would be helpful too. For example, if you consider creating the following callback for a dynamic dropdown:
the dropdown is a dcc, yet you have to return it as a div with children, without it being in a list. This baffled me for ages as I was trying to return it as: This is because it is inline with outputting a dcc in this example:
but: Is it possible to check the type of the content returned by a callback and check that it is compatible with the output type specified in the callback when in debug mode? |
We are actually working on a big PR #340 which does just that. I'm pushing changes to it currently and will have a pre-release soon, so you can subscribe to that and be one of the first to test-drive it 🙂 Also I would expect those examples above to work, do they not? If so it may be a bug we can open. |
Yes it doesnt work with my current setup. Before this is opened i will update my packages and build some toy examples tomorrow to confirm its still relevant. |
Yeah, if a callback updates
|
This is a bug. I've created a Gist to illustrate 2 problems. I've posted version info below to replicate the issue.
@rmarren1 have subscribed to #340 and happy to test drive the new updates. The Dash versions to replicate the above are currently inline with official installation versions:
|
Check line 51 of the gist, you end have This is a tough error to debug though, as it silently fails and just says |
Good spot! and thanks! Actually, to hammer home the importance of your work on #340, I did spot it was a tuple but forgot about it trying to solve error 1. |
- turn on strictPropertyInitialization - turn on strictBindCallApply
- turn on strictPropertyInitialization - turn on strictBindCallApply
Update plotly.js to 1.42.2
Hi - we are tidying up stale issues and PRs in Plotly's public repositories so that we can focus on things that are most important to our community. If this issue is still a concern, please add a comment letting us know what recent version of our software you've checked it with so that I can reopen it and add it to our backlog. (Please note that we will give priority to reports that include a short reproducible example.) If you'd like to submit a PR, we'd be happy to prioritize a review, and if it's a request for tech support, please post in our community forum. Thank you - @gvwilson |
I use the "suppress_callback_exceptions" option a lot but think it makes sense to have an option where we can add e.g. a decorator to callbacks we care about and see why they aren't firing (.e.g "cannot see 'x' div, or 'cannot parse children of div' or w/e. I can see this being super helpful, rather than completely suppressing the exceptions and leaving the developer to guess everywhere.
The text was updated successfully, but these errors were encountered: