โ11-18-2024 02:33 AM
Hi All,
With the new availability of debugging notebooks are really great. But how do you debug a workflow? Any suggestions on recommended practices on how to debug workflows?
Best R, Thomas
โ11-18-2024 05:50 AM - edited โ11-18-2024 05:51 AM
You can define widgets in your notebook in the following way (see screenshot). When databricks workflow is running it will pass all required parameters and you can use code you've provided to read these values key1=dbutils.widgets.get("Key1").
But, let's say that something went wrong and you want to debug. Than just fill parameters of widget with values and
and now you can debug without changing any code ๐
dbutils.widgets.text("param_source_schema", defaultValue="")
param_source_schema = dbutils.widgets.get("param_source_schema")
โ11-18-2024 03:18 AM
Please refer to this doc and confirm if it's helpful
https://docs.databricks.com/en/jobs/repair-job-failures.html#re-run-failed-and-skipped-tasks
โ11-18-2024 05:09 AM
I am not trying to fix a failed job, but trying to find an approach to debug a workflow line by line. You can debug a note book, but how do you debug a workflow?
โ11-18-2024 05:14 AM - edited โ11-18-2024 05:15 AM
Hi @Sega2 ,
You can't debug from workflows UI. If notebook/python code failed in workflow, you need to manually find that notebook/module and then you can run it manually (passing all required parameters, if any) and use debugger from there.
โ11-18-2024 05:36 AM
Thanks. I think we are getting closer now. What is the recommended practice for passing parameters in the notebook? In the notebook you have something like
โ11-18-2024 05:50 AM - edited โ11-18-2024 05:51 AM
You can define widgets in your notebook in the following way (see screenshot). When databricks workflow is running it will pass all required parameters and you can use code you've provided to read these values key1=dbutils.widgets.get("Key1").
But, let's say that something went wrong and you want to debug. Than just fill parameters of widget with values and
and now you can debug without changing any code ๐
dbutils.widgets.text("param_source_schema", defaultValue="")
param_source_schema = dbutils.widgets.get("param_source_schema")
โ11-19-2024 08:24 AM
That makes perfectly sense. Seems like thats the way to go. Thanks alot appreciated. I am new to Databrix how do you normally debug as an experienced DBX developer? Databricks connect or just in the browser and built in UI?
Join a Regional User Group to connect with local Databricks users. Events will be happening in your city, and you wonโt want to miss the chance to attend and share knowledge.
If there isnโt a group near you, start one and help create a community that brings people together.
Request a New Group