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

Bug - dbt found models with the same name #311

Closed
1 task
vietsqsp opened this issue Jun 21, 2023 · 5 comments
Closed
1 task

Bug - dbt found models with the same name #311

vietsqsp opened this issue Jun 21, 2023 · 5 comments
Labels
bug Something isn't working

Comments

@vietsqsp
Copy link

Expected behavior

I run:

dbt run --models +MY_MODEL+

in my trino project. I should get:

Running with dbt==1.5.0
...

Actual behavior

I run:

dbt run --models +MY_MODEL+

in my trino project. I should get:

Compilation Error
  dbt found two models with the name "MY_MODEL".
  
  Since these resources have the same name, dbt will be unable to find the correct resource
  when looking for ref("MY_MODEL").
  
  To fix this, change the name of one of these resources:
  - model.MY_TRINO_PROJECT.MY_MODEL (models/marts/MY_DATASET/target/compiled/MY_TRINO_PROJECT/models/marts/MY_DATASET/MY_MODEL.sql)
  - model.MY_TRINO_PROJECT.MY_MODEL (models/marts/MY_DATASET/MY_MODEL.sql)

Steps To Reproduce

Run a model inside the dataset folder, not the project folder.

⚠️ This doesn't happen in my BigQuery project using a similar dbt_project.yml file.

❯ pip show dbt-trino
Name: dbt-trino
Version: 1.5.0
❯ pip show dbt-bigquery
Name: dbt-bigquery
Version: 1.5.1

Log output/Screenshots

No response

Operating System

macOS Ventura 13.4

dbt version

1.5.0

Trino Server version

1.5.0

Python version

3.7.13

Are you willing to submit PR?

  • Yes I am willing to submit a PR!
@vietsqsp vietsqsp added the bug Something isn't working label Jun 21, 2023
@vietsqsp
Copy link
Author

This is related to: dbt-labs/dbt-core#7465

@hovaesco
Copy link
Contributor

Hopefully dbt-core v1.5.2 would solve the issue.

@hovaesco
Copy link
Contributor

@vietsqsp have you tested it v1.5.2 ?

@vietsqsp
Copy link
Author

@hovaesco I actually upgraded to dbt-core v1.5.3 and I don't have this error anymore. I'll close this ticket. Thank you.

@hovaesco
Copy link
Contributor

thank you @vietsqsp

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants