-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Better error messages #445
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.
you should spend a couple minutes cleaning up yaml_helper.py. beyond that, this looks excellent.
dbt/clients/yaml_helper.py
Outdated
return yaml.safe_load(contents) | ||
except (yaml.scanner.ScannerError, yaml.YAMLError) as e: | ||
if hasattr(e, 'problem_mark'): | ||
error = contextualized_yaml_erro(contents, 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.
contextualized_yaml_error?
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.
🤦♂️
dbt/clients/yaml_helper.py
Outdated
else: | ||
error = dbt.compat.to_string(e) | ||
|
||
raise dbt.exceptions.ValidationException(error) |
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 great, but the code here is a little rough around the edges.
@cmcarthur good points -- i think this is ready for another look |
* wip * overhauled yaml validation error messages * use yaml client (mostly) everywhere * fix imports * fix yaml client namespace for python2 * pep8 * code cleanup + typos automatic commit by git-black, original commits: e9177e2
Better error messages for #294
No
profile
specified indbt_project.yml
or provided on CLI. Noprofiles.yml
fileprofiles.yml
not found (but a profile is specified indbt_project.yml
)profiles.yml
contains invalid yamlInvalid yaml in a
schema.yml
file:@cmcarthur let me know if you think i went overboard here...