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

Partial parsing: duplicate resource error (redux) #2064

Closed
drewbanin opened this issue Jan 21, 2020 · 0 comments · Fixed by #2065
Closed

Partial parsing: duplicate resource error (redux) #2064

drewbanin opened this issue Jan 21, 2020 · 0 comments · Fixed by #2065
Labels
bug Something isn't working partial_parsing
Milestone

Comments

@drewbanin
Copy link
Contributor

Describe the bug

Similar to #2055, the --partial-parse flag causes dbt to raise a compilation error for duplicate resources when no such duplicates exist with the following dbt_project.yml config:

...
source-paths: ["models", "tests"]
test-paths: ["tests"]

....

I'm a little bit stumped as to why this is happening, but I can replicate it pretty readily.

Steps To Reproduce

  1. Update dbt_project.yml to look include:
source-paths: ["models", "tests"]
test-paths: ["tests"]
  1. Add a sql file (select 1 as id) in the tests/ directory

  2. run the following commands:

rm -rf target
dbt --partial-parse compile
dbt --partial-parse compile

The second invocation should result in:

Running with dbt=0.15.2-a1
Encountered an error:
Compilation Error
  dbt found two resources with the name "my_test". Since these resources have the same name,
  dbt will be unable to find the correct resource when ref("my_test") is used. To fix this,
  change the name of one of these resources:
  - model.my_project.my_test (tests/my_test.sql)
  - model.my_project.my_test (tests/my_test.sql)

The output of dbt --version:
Using 0.15.1-a2 with this PR included: #2056

@drewbanin drewbanin added the bug Something isn't working label Jan 21, 2020
@drewbanin drewbanin added this to the 0.15.2 milestone Jan 21, 2020
beckjake added a commit that referenced this issue Jan 24, 2020
…ve-resource-types

ignore alternative resource types when reading partial parse cache (#2064)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working partial_parsing
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants