The missing guide to debug() in dbt

This is a companion discussion topic for the original entry at The missing guide to debug() in dbt | dbt Developer Blog

Thanks @bper! I’ve never used debug() but am now keen to give it a try myself. There’s definitely times I would have found it useful in the past :eyes:

One question: you said in the post

if […] while in debug mode you press c, the debugger will stop at each of your breakpoints

Does this mean that a {{ debug() }} call very early on in your file would be almost impossible to trigger? I can understand how enough time would pass to trigger the breakpoint if you’re trying to capture something that happens in an on-run-end hook, but what about if you were debugging something in on-run-start?

Or are you also allowed to press c while dbt is doing the initial parse work etc, which means that you don’t need the quickest draw in the west to make it work?

Great question @joellabes

c stands for continue, e.g. continue from the current breakpoint until the next one (or until the end of the program).

So you don’t need to type c to trigger the first breakpoint, it will happen automatically (and you wont’t need the quickest draw in the west). If you have multiple breakpoints though, after you enter the first one you might want to type c to execute all the code until the next one.

1 Like