cancel
Showing results for 
Search instead for 
Did you mean: 
Administration & Architecture
Explore discussions on Databricks administration, deployment strategies, and architectural best practices. Connect with administrators and architects to optimize your Databricks environment for performance, scalability, and security.
cancel
Showing results for 
Search instead for 
Did you mean: 

Questions About Notebook Debugging Tools

help_needed_445
Contributor

I'm researching the different ways to debug in databricks notebooks and have some questions.

1. Can the python breakpoint() function be used in notebooks? This article says it can be used https://www.databricks.com/blog/new-debugging-features-databricks-notebooks-variable-explorer but this article says it cannot be used https://docs.databricks.com/aws/en/languages/python. The first is from 2023 so it may be outdated. I tried it and it did not appear to work at all since I expected the debugger toolbar to appear but it did not.

2. Is there a %debug magic command? I have found very little information on this in google but when I run that command in its own cell it seems to change the format of the cell and allows me to enter commands like continue and exit. If anyone knows about this command can you tell me if it is useful compared to the interactive debugger mentioned here https://docs.databricks.com/aws/en/notebooks/debugger?

3. Is the "best" all around debugging tool the interactive debugger mentioned here https://docs.databricks.com/aws/en/notebooks/debugger? I couldn't find much information on other tools other than connecting databricks to a separate IDE.

4. Does anyone recommend the pdb.set_trace() function from the pdb module? I am able to enter a debug mode when I include that function in a notebook cell but haven't used it much. Would appreciate any good resources.

Thank you!

 

1 REPLY 1

jack_zaldivar
Databricks Employee
Databricks Employee

Hi @help_needed_445 ! Can you give a bit more information on your environment? Which cloud are you operating in where you are not able to use the native debugging tool? I have tested in an Azure workspace by adding a breakpoint in the gutter of a specific line of a Python cell and then going to Run --> Run and Debug --> Debug Cell (Option + Shift + D [on Mac]) and it is functioning correctly for me in this environment. I am also able to open the Variables viewer from the charm bar on the right and watch the variables change (jack_zaldivar_0-1760745108407.png).

 

In case this didn't help at all, can you explain a bit more about the issue you're facing or what you're attempting to accomplish?

 

 

Join Us as a Local Community Builder!

Passionate about hosting events and connecting people? Help us grow a vibrant local community—sign up today to get started!

Sign Up Now