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

Commit d3f8dc1

Browse files
committed
use a single error message
1 parent ef2e919 commit d3f8dc1

File tree

1 file changed

+3
-8
lines changed

1 file changed

+3
-8
lines changed

data_diff/dbt_parser.py

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -64,14 +64,9 @@ def __init__(self, profiles_dir_override: str, project_dir_override: str) -> Non
6464

6565
def get_datadiff_variables(self) -> dict:
6666
doc_url = "https://docs.datafold.com/development_testing/open_source#configure-your-dbt-project"
67-
vars = get_from_dict_with_raise(
68-
self.project_dict, "vars", f"No vars: found in dbt_project.yml.\n\nConfigure your dbt project: \n{doc_url}\n"
69-
)
70-
return get_from_dict_with_raise(
71-
vars,
72-
"data_diff",
73-
f"data_diff: section not found in dbt_project.yml.\n\nConfigure your dbt project: \n{doc_url}\n",
74-
)
67+
error_message = f"vars: data_diff: section not found in dbt_project.yml.\n\nTo solve this, please configure your dbt project: \n{doc_url}\n"
68+
vars = get_from_dict_with_raise(self.project_dict, "vars", error_message)
69+
return get_from_dict_with_raise(vars, "data_diff", error_message)
7570

7671
def get_models(self):
7772
with open(self.project_dir / RUN_RESULTS_PATH) as run_results:

0 commit comments

Comments
 (0)