Skip to content

Commit

Permalink
When parsing 'all_sources' should be a list of unique dirs (#5176) (#…
Browse files Browse the repository at this point in the history
…5256)

* When parsing 'all_sources' should be a list of unique dirs

* Changie

* Fix some unit tests of all_source_paths

* Convert 039_config_tests

* Remove old 039_config_tests

* Add test for duplicate directories in 'all_source_files'

(cherry picked from commit f633e99)

Co-authored-by: Gerda Shank <[email protected]>
  • Loading branch information
github-actions[bot] and gshank committed May 16, 2022
1 parent 9c6bdca commit c74e9dd
Show file tree
Hide file tree
Showing 31 changed files with 712 additions and 635 deletions.
7 changes: 7 additions & 0 deletions .changes/unreleased/Fixes-20220427-102648.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
kind: Fixes
body: When parsing 'all_sources' should be a list of unique dirs
time: 2022-04-27T10:26:48.648388-04:00
custom:
Author: gshank
Issue: "5120"
PR: "5176"
6 changes: 5 additions & 1 deletion core/dbt/config/project.py
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,11 @@ def _all_source_paths(
analysis_paths: List[str],
macro_paths: List[str],
) -> List[str]:
return list(chain(model_paths, seed_paths, snapshot_paths, analysis_paths, macro_paths))
# We need to turn a list of lists into just a list, then convert to a set to
# get only unique elements, then back to a list
return list(
set(list(chain(model_paths, seed_paths, snapshot_paths, analysis_paths, macro_paths)))
)


T = TypeVar("T")
Expand Down
1 change: 1 addition & 0 deletions core/dbt/tests/fixtures/project.py
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,7 @@ def dbt_project_yml(project_root, project_config_update, logs_dir):
if project_config_update:
project_config.update(project_config_update)
write_file(yaml.safe_dump(project_config), project_root, "dbt_project.yml")
return project_config


# Fixture to provide packages as either yaml or dictionary
Expand Down
11 changes: 0 additions & 11 deletions test/integration/039_config_tests/extra-alt/untagged.yml

This file was deleted.

11 changes: 0 additions & 11 deletions test/integration/039_config_tests/extra-alt/untagged2.yml

This file was deleted.

31 changes: 0 additions & 31 deletions test/integration/039_config_tests/models-alt/schema.yml

This file was deleted.

15 changes: 0 additions & 15 deletions test/integration/039_config_tests/models-alt/tagged/model.sql

This file was deleted.

5 changes: 0 additions & 5 deletions test/integration/039_config_tests/models-alt/untagged.sql

This file was deleted.

2 changes: 0 additions & 2 deletions test/integration/039_config_tests/models-get/any_model.sql

This file was deleted.

1 change: 0 additions & 1 deletion test/integration/039_config_tests/models-ok/ok.sql

This file was deleted.

26 changes: 0 additions & 26 deletions test/integration/039_config_tests/models/schema.yml

This file was deleted.

15 changes: 0 additions & 15 deletions test/integration/039_config_tests/models/tagged/model.sql

This file was deleted.

5 changes: 0 additions & 5 deletions test/integration/039_config_tests/models/untagged.sql

This file was deleted.

8 changes: 0 additions & 8 deletions test/integration/039_config_tests/project/dbt_project.yml

This file was deleted.

24 changes: 0 additions & 24 deletions test/integration/039_config_tests/project/profiles.yml

This file was deleted.

2 changes: 0 additions & 2 deletions test/integration/039_config_tests/seeds-alt/some_seed.csv

This file was deleted.

2 changes: 0 additions & 2 deletions test/integration/039_config_tests/seeds/seed.csv

This file was deleted.

Loading

0 comments on commit c74e9dd

Please sign in to comment.