Dash webapps: logging errors within callback code?

MarkPundurs
MarkPundurs Dataiku DSS Core Designer, Dataiku DSS ML Practitioner, Registered Posts: 27 ✭✭✭✭

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.

Tagged:

Answers

  • VitaliyD
    VitaliyD Dataiker, Dataiku DSS Core Designer, Dataiku DSS Adv Designer Posts: 102 Dataiker

    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:

    Screenshot 2023-04-26 at 17.23.50.pngScreenshot 2023-04-26 at 17.24.14.png

    Best,

    Vitaliy

  • MarkPundurs
    MarkPundurs Dataiku DSS Core Designer, Dataiku DSS ML Practitioner, Registered Posts: 27 ✭✭✭✭

    Was your testing on DSS v11?

  • VitaliyD
    VitaliyD Dataiker, Dataiku DSS Core Designer, Dataiku DSS Adv Designer Posts: 102 Dataiker
Setup Info
    Tags
      Help me…