-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
making error msg for malformed packages.yml better #2078
making error msg for malformed packages.yml better #2078
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is going to be really great! Check out some of my suggestions in here - happy to discuss if you feel differently about any of them :)
Nice work so far!
adding actual error text into wrapper Co-Authored-By: Drew Banin <drew@fishtownanalytics.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Alright! One more round of changes, and then this PR will be ready to roll :)
core/dbt/config/project.py
Outdated
@@ -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)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ooops - I think I led you astray here - we're actually going to want str(e.message)
MALFORMED_PACKAGE_ERROR.format(error=str(e)) | |
MALFORMED_PACKAGE_ERROR.format(error=str(e.msg)) |
In practice, this should result in output like:
Which i think is pretty good all things considered!
Note: we'll also want to remove the duplicated link on line 71!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the review!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great - merging this when the tests pass! Thanks for your contribution to dbt 😃 🎉
core/dbt/config/project.py
Outdated
@@ -59,6 +59,17 @@ | |||
--no-version-check | |||
""" | |||
|
|||
MALFORMED_PACKAGE_ERROR = """\ | |||
The packages.yml file in this project is malformed. Please double check the contents |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see that our style guide checker (flake8) failed with this error:
core/dbt/config/project.py:63:80: E501 line too long (84 > 79 characters)
Can you just split this onto two lines to appease flake8? Thanks!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
one more quick one and then this will be ready to merge :)
core/dbt/config/project.py
Outdated
@@ -59,6 +59,17 @@ | |||
--no-version-check | |||
""" | |||
|
|||
MALFORMED_PACKAGE_ERROR = """\ | |||
The packages.yml file in this project is malformed. Please double check |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
flake8 run-test: commands[0] | /bin/bash -c '$(which flake8) --select=E,W,F --ignore=W504 core/dbt plugins/*/dbt'
core/dbt/config/project.py:63:72: W291 trailing whitespace
The packages.yml file in this project is malformed. Please double check | |
The packages.yml file in this project is malformed. Please double check |
Thanks for sticking with this one @sonac! Merging this for our 0.16.0 release :D |
I messed up the previous PR during rebase and it was automatically closed. Here's new and clean one.
Fixes #2017