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 #2055

Closed
drewbanin opened this issue Jan 17, 2020 · 1 comment
Closed

Partial parsing: duplicate resource error #2055

drewbanin opened this issue Jan 17, 2020 · 1 comment
Labels
bug Something isn't working partial_parsing
Milestone

Comments

@drewbanin
Copy link
Contributor

Describe the bug

When the --partial-parse flag is enable, dbt can fail with an errant compilation error:

$ dbt --partial-parse compile
Running with dbt=0.15.0
Encountered an error:
Compilation Error
  dbt found two resources with the name "adwords_ad_performance_adapter". Since these resources have the same name,
  dbt will be unable to find the correct resource when ref("adwords_ad_performance_adapter") is used. To fix this,
  change the name of one of these resources:
  - model.adwords.adwords_ad_performance_adapter (models/router/adapter/criteria/adwords_ad_performance_adapter.sql)
  - model.adwords.adwords_ad_performance_adapter (models/router/adapter/criteria/adwords_ad_performance_adapter.sql)

dbt is reporting the same model twice. Interestingly, there actually are two instances of models named adwords_ad_performance_adapter in the adwords package:

These models are conditionally enabled using a variable, adapter_value, defined in the dbt_project.yml file.

It's not yet clear to me if dbt is failing because it's finding both of these models and reporting an errant error message, or if dbt really is picking up the same model twice somehow.

Steps To Reproduce

Add the following to packages.yml:

packages:
  - package: fishtown-analytics/adwords
    version: 0.2.9

Add the following to dbt_project.yml:

models:
    adwords:
        vars:
            adapter_value: criteria

Create a model called adwords_criteria_performance.sql with the contents:

select 1 as id
# Succeeds
$ dbt compile

# Fails with duplicate model error
$ dbt --partial-parse compile

Expected behavior

dbt should compile and run this project successfully.

The output of dbt --version:

dbt v0.15.0
@drewbanin drewbanin added the bug Something isn't working label Jan 17, 2020
@drewbanin drewbanin added this to the 0.15.2 milestone Jan 18, 2020
beckjake added a commit that referenced this issue Jan 19, 2020
…disabled-models

Fix partial parsing with disabled models (#2055)
@drewbanin
Copy link
Contributor Author

fixed in #2056

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

No branches or pull requests

2 participants