Skip to content
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

dbt should throw a compilation error for shared resource paths #1606

Closed
clrcrl opened this issue Jul 12, 2019 · 3 comments
Closed

dbt should throw a compilation error for shared resource paths #1606

clrcrl opened this issue Jul 12, 2019 · 3 comments

Comments

@clrcrl
Copy link
Contributor

clrcrl commented Jul 12, 2019

Issue

Issue description

If resources are configured to have the same path, dbt doesn't throw any sort of error.
e.g.

# dbt_project.yml
source-paths: ["models"]
test-paths: ["models"]

Results

When you dbt compile it runs fine. If you dbt test --data, you'll get errors back because the select statements return rows.

Expected results

This should throw an error:

source-paths: ["models"]
test-paths: ["models"]

As should this

source-paths: ["models"]
test-paths: ["models/tests"]

This should not:

source-paths: ["resources/models"]
test-paths: ["resources/tests"]

System information

dbt version 0.14.0

@beckjake
Copy link
Contributor

It's probably worth noting for whoever ends up implementing this that docs-paths can and by default does overlap with source-paths (or really, anything, since it looks for .md instead of .sql)

@drewbanin
Copy link
Contributor

I'd like these paths to go away long-term. Things like the {% snapshot %} blocks + #184 will mean that each resource will define what type of resource it is. We already do this for {% docs %} blocks, and it would be good to think about how to do it for custom data tests too! The really cool benefit of this approach is that multiple resource types can live inside of the same file (if desired).

I'd be in favor of renaming these paths more sensibly (#1607) than adding yet more logic around path names

@clrcrl
Copy link
Contributor Author

clrcrl commented Jul 12, 2019

OK! Happy for you to close in that case 🙂

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants