From 9eaf2438dde7fb26e8638f280eeea4a49be254b8 Mon Sep 17 00:00:00 2001 From: sonac Date: Thu, 30 Jan 2020 10:56:31 +0100 Subject: [PATCH 1/5] making error msg for malformed packages.yml better --- core/dbt/config/project.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/core/dbt/config/project.py b/core/dbt/config/project.py index 620aa0773bc..3fb5fc73f66 100644 --- a/core/dbt/config/project.py +++ b/core/dbt/config/project.py @@ -59,6 +59,11 @@ --no-version-check """ +MALFORMED_PACKAGE_ERROR = """\ +packages.yml is malformed, please make sure that it matches +https://docs.getdbt.com/docs/package-management#section-how-do-i-add-a-package-to-my-project +""" + def _list_if_none(value): if value is None: @@ -130,7 +135,7 @@ def package_config_from_data(packages_data): packages = PackageConfig.from_dict(packages_data) except ValidationError as e: raise DbtProjectError( - 'Invalid package config: {}'.format(validator_error_message(e)) + MALFORMED_PACKAGE_ERROR ) from e return packages From 7fae368c0d084d1696a9cde08e922ff6acd61677 Mon Sep 17 00:00:00 2001 From: Andrii Date: Fri, 31 Jan 2020 13:36:07 +0200 Subject: [PATCH 2/5] Apply suggestions from code review adding actual error text into wrapper Co-Authored-By: Drew Banin --- core/dbt/config/project.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/core/dbt/config/project.py b/core/dbt/config/project.py index 3fb5fc73f66..33b131976c4 100644 --- a/core/dbt/config/project.py +++ b/core/dbt/config/project.py @@ -60,7 +60,14 @@ """ MALFORMED_PACKAGE_ERROR = """\ -packages.yml is malformed, please make sure that it matches +The packages.yml file in this project is malformed. Please double check the contents +of this file and fix any errors before retrying. + +You can find more information on the syntax for this file here: +https://docs.getdbt.com/docs/package-management + +Validator Error: +{error} https://docs.getdbt.com/docs/package-management#section-how-do-i-add-a-package-to-my-project """ @@ -135,7 +142,7 @@ def package_config_from_data(packages_data): packages = PackageConfig.from_dict(packages_data) except ValidationError as e: raise DbtProjectError( - MALFORMED_PACKAGE_ERROR + MALFORMED_PACKAGE_ERROR.format(error=str(e)) ) from e return packages From 5823683265588adf5cabdcab8f2edb232860e683 Mon Sep 17 00:00:00 2001 From: sonac Date: Fri, 31 Jan 2020 17:03:44 +0100 Subject: [PATCH 3/5] injecting only message from validation error --- core/dbt/config/project.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/core/dbt/config/project.py b/core/dbt/config/project.py index 33b131976c4..cc1ef6f1435 100644 --- a/core/dbt/config/project.py +++ b/core/dbt/config/project.py @@ -68,7 +68,6 @@ Validator Error: {error} -https://docs.getdbt.com/docs/package-management#section-how-do-i-add-a-package-to-my-project """ @@ -142,7 +141,7 @@ def package_config_from_data(packages_data): packages = PackageConfig.from_dict(packages_data) except ValidationError as e: raise DbtProjectError( - MALFORMED_PACKAGE_ERROR.format(error=str(e)) + MALFORMED_PACKAGE_ERROR.format(error=str(e.message)) ) from e return packages From fa40c41124b3ab6e2ac9341ffe30d0a44eb06e21 Mon Sep 17 00:00:00 2001 From: sonac Date: Tue, 4 Feb 2020 10:08:03 +0100 Subject: [PATCH 4/5] splitting long line --- core/dbt/config/project.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/dbt/config/project.py b/core/dbt/config/project.py index cc1ef6f1435..09e8f99fc96 100644 --- a/core/dbt/config/project.py +++ b/core/dbt/config/project.py @@ -60,8 +60,8 @@ """ MALFORMED_PACKAGE_ERROR = """\ -The packages.yml file in this project is malformed. Please double check the contents -of this file and fix any errors before retrying. +The packages.yml file in this project is malformed. Please double check +the contents of this file and fix any errors before retrying. You can find more information on the syntax for this file here: https://docs.getdbt.com/docs/package-management From d354aa6f093e3533adfbf907cd720e45619bb0e3 Mon Sep 17 00:00:00 2001 From: sonac Date: Thu, 6 Feb 2020 10:01:51 +0100 Subject: [PATCH 5/5] removing trailing space --- core/dbt/config/project.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/dbt/config/project.py b/core/dbt/config/project.py index 09e8f99fc96..3ba025fa7cc 100644 --- a/core/dbt/config/project.py +++ b/core/dbt/config/project.py @@ -60,7 +60,7 @@ """ MALFORMED_PACKAGE_ERROR = """\ -The packages.yml file in this project is malformed. Please double check +The packages.yml file in this project is malformed. Please double check the contents of this file and fix any errors before retrying. You can find more information on the syntax for this file here: