Dash webapps: logging errors within callback code?
In a dash webapp, I was trying to filter a table by the value selected in a dropdown. It was silently failing to alter the table contents because in the callback function I was calling df.drop('colname') instead of df.drop(columns='colname'). The backend ran without reported error or log file entry.
How can I log such errors? It seems dash's app.run[_server] function has debugging options (https://dash.plotly.com/reference), but that function appears to be called behind the curtains in DSS.
Answers
-
Hi,
Technically using df.drop('colname') in the callback function should of throw the exception that should be printed in the logs unless you are using try/except or df.drop('colname', errors='ignore') which suppresses the error. However, it is impossible to say more without seeing your code.
Below are the screenshots of my test to confirm the above:
Best,
Vitaliy
-
Was your testing on DSS v11?
-
Yes, 11.4.0.