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

Commit c646505

Browse files
committed
if dbt ls throws an exception, raise that first
1 parent ce52e8b commit c646505

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

data_diff/dbt_parser.py

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -126,18 +126,17 @@ def get_dbt_selection_models(self, dbt_selection: str) -> List[str]:
126126
self.project_dir,
127127
]
128128
)
129-
if results.success and results.result:
129+
if results.exception:
130+
raise results.exception
131+
elif results.success and results.result:
130132
model_list = [json.loads(model)["unique_id"] for model in results.result]
131133
models = [self.manifest_obj.nodes.get(x) for x in model_list]
132134
return models
133135
elif not results.result:
134136
raise Exception(f"No dbt models found for `--select {dbt_selection}`")
135137
else:
136-
if results.exception:
137-
raise results.exception
138-
else:
139-
logger.debug(str(results))
140-
raise Exception("Encountered an error while finding `--select` models")
138+
logger.debug(str(results))
139+
raise Exception("Encountered an unexpected error while finding `--select` models")
141140

142141
def get_run_results_models(self):
143142
with open(self.project_dir / RUN_RESULTS_PATH) as run_results:

0 commit comments

Comments
 (0)