Compare commits

...

2 Commits

Author SHA1 Message Date
Chenyu Li
7a618c8839 add changelog 2022-07-24 12:26:54 -07:00
Chenyu Li
3456de5fa2 remove env var to enable debug and add breakpoint 2022-07-24 12:21:25 -07:00
2 changed files with 21 additions and 10 deletions

View File

@@ -0,0 +1,7 @@
kind: Features
body: Add breakpoint() function and remove env var requirment to enable it
time: 2022-07-24T12:26:24.593183-07:00
custom:
Author: ChenyuLInx
Issue: "0"
PR: "5519"

View File

@@ -311,18 +311,22 @@ class BaseContext(metaclass=ContextMeta):
msg = f"Env var required but not provided: '{var}'"
raise_parsing_error(msg)
if os.environ.get("DBT_MACRO_DEBUGGING"):
@contextmember
@staticmethod
def debug(frame_level=3):
@contextmember
@staticmethod
def debug():
"""Enter a debugger at this line in the compiled jinja code."""
import sys
import ipdb # type: ignore
"""Enter a debugger at this line in the compiled jinja code."""
import sys
import ipdb # type: ignore
frame = sys._getframe(3)
ipdb.set_trace(frame)
return ""
frame = sys._getframe(frame_level)
ipdb.set_trace(frame)
return ""
@contextmember
@staticmethod
def breakpoint():
BaseContext.debug(frame_level=4)
@contextmember("return")
@staticmethod