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

Commit 796c5aa

Browse files
authored
Merge pull request #556 from dlawin/reorder_select_error_handling
if dbt ls throws an exception, raise that first
2 parents 7f5d9e8 + c646505 commit 796c5aa

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

data_diff/dbt_parser.py

+5-6
Original file line numberDiff line numberDiff line change
@@ -135,18 +135,17 @@ def get_dbt_selection_models(self, dbt_selection: str) -> List[str]:
135135
self.project_dir,
136136
]
137137
)
138-
if results.success and results.result:
138+
if results.exception:
139+
raise results.exception
140+
elif results.success and results.result:
139141
model_list = [json.loads(model)["unique_id"] for model in results.result]
140142
models = [self.manifest_obj.nodes.get(x) for x in model_list]
141143
return models
142144
elif not results.result:
143145
raise Exception(f"No dbt models found for `--select {dbt_selection}`")
144146
else:
145-
if results.exception:
146-
raise results.exception
147-
else:
148-
logger.debug(str(results))
149-
raise Exception("Encountered an error while finding `--select` models")
147+
logger.debug(str(results))
148+
raise Exception("Encountered an unexpected error while finding `--select` models")
150149

151150
def get_run_results_models(self):
152151
with open(self.project_dir / RUN_RESULTS_PATH) as run_results:

0 commit comments

Comments
 (0)