Skip to content

Commit

Permalink
Add warning for missing constraints. Fixes #592
Browse files Browse the repository at this point in the history
  • Loading branch information
drewbanin committed Nov 19, 2017
1 parent f039bb6 commit 0156458
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions dbt/parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -452,8 +452,12 @@ def parse_schema_tests(tests, root_project, projects, macros=None):
if test_yml is None:
continue

no_tests_warning = ("* WARNING: No constraints found for model"
" '{}' in file {}\n")
for model_name, test_spec in test_yml.items():
if test_spec is None or test_spec.get('constraints') is None:
test_path = test['original_file_path']
logger.warn(no_tests_warning.format(model_name, test_path))
continue

for test_type, configs in test_spec.get('constraints', {}).items():
Expand Down

0 comments on commit 0156458

Please sign in to comment.