Skip to content

Commit

Permalink
PR feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
Jacob Beck committed Jul 31, 2018
1 parent 37c4279 commit 2e1aaac
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 11 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

- Extend catalog and manifest to also support Snowflake, BigQuery, and Redshift
- Add a 'generated_at' field to both the manifest and the catalog.
- Verison 2 of schema.yml, which allows users to create table and column comments that end up in the manifest
- Version 2 of schema.yml, which allows users to create table and column comments that end up in the manifest

## dbt 0.10.2 (unreleased, codename: Betsy Ross)

Expand Down
12 changes: 12 additions & 0 deletions dbt/exceptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -369,3 +369,15 @@ def raise_patch_targets_not_found(patches):
patch_list
)
)


def raise_duplicate_patch_name(name, patch_1, patch_2):
raise_compiler_error(
'dbt found two schema.yml entries for the same model named {}. The '
'first patch was specified in {} and the second in {}. Models and '
'their associated columns may only be described a single time.'.format(
name,
patch_1,
patch_2,
)
)
12 changes: 2 additions & 10 deletions dbt/loader.py
Original file line number Diff line number Diff line change
Expand Up @@ -143,16 +143,8 @@ def load_all(cls, root_project, all_projects, macros=None):

for name, patch in project_patches.items():
if name in patches:
dbt.exceptions.raise_compiler_error(
'dbt found two schema.yml entries for the same model '
'named {}. The first patch was specified in {} and '
'the second in {}. Models and their associated '
'columns may only be described a single time.'.format(
name,
patch.original_file_path,
patches[name].original_file_path,
)
)
dbt.exceptions.raise_duplicate_patch_name(name, patch,
patches[name])
patches[name] = patch
return tests, patches

Expand Down

0 comments on commit 2e1aaac

Please sign in to comment.