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

if dbt ls throws an exception, raise that first #556

Merged
merged 1 commit into from
May 5, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 5 additions & 6 deletions data_diff/dbt_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,18 +126,17 @@ def get_dbt_selection_models(self, dbt_selection: str) -> List[str]:
self.project_dir,
]
)
if results.success and results.result:
if results.exception:
raise results.exception
elif results.success and results.result:
model_list = [json.loads(model)["unique_id"] for model in results.result]
models = [self.manifest_obj.nodes.get(x) for x in model_list]
return models
elif not results.result:
raise Exception(f"No dbt models found for `--select {dbt_selection}`")
else:
if results.exception:
raise results.exception
else:
logger.debug(str(results))
raise Exception("Encountered an error while finding `--select` models")
logger.debug(str(results))
raise Exception("Encountered an unexpected error while finding `--select` models")

def get_run_results_models(self):
with open(self.project_dir / RUN_RESULTS_PATH) as run_results:
Expand Down