Skip to content
This repository was archived by the owner on May 17, 2024. It is now read-only.

Commit 7f5d9e8

Browse files
authored
Merge pull request #555 from dlawin/macro_debugging_error
instantiate MACRO_DEBUGGING global for dbt
2 parents 40e24e0 + eef79ab commit 7f5d9e8

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

data_diff/dbt_parser.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
from argparse import Namespace
12
from collections import defaultdict
23
import json
34
import os
@@ -22,6 +23,14 @@ def import_dbt_dependencies():
2223
raise RuntimeError("Could not import 'dbt' package. You can install it using: pip install 'data-diff[dbt]'.")
2324

2425
# dbt 1.5+ specific stuff to power selection of models
26+
try:
27+
# ProfileRenderer.render_data() fails without instantiating global flag MACRO_DEBUGGING in dbt-core 1.5
28+
from dbt.flags import set_flags
29+
30+
set_flags(Namespace(MACRO_DEBUGGING=False))
31+
except:
32+
pass
33+
2534
try:
2635
from dbt.cli.main import dbtRunner
2736
except ImportError:

0 commit comments

Comments
 (0)