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

[CT-2077] [Bug] duplicate model conflict with sub projects #6932

Closed
2 tasks done
leo-schick opened this issue Feb 10, 2023 · 1 comment
Closed
2 tasks done

[CT-2077] [Bug] duplicate model conflict with sub projects #6932

leo-schick opened this issue Feb 10, 2023 · 1 comment
Labels
bug Something isn't working duplicate This issue or pull request already exists

Comments

@leo-schick
Copy link
Contributor

leo-schick commented Feb 10, 2023

Is this a new bug in dbt-core?

  • I believe this is a new bug in dbt-core
  • I have searched the existing issues, and I could not find an existing issue for this bug

Current Behavior

I have two projects:

  • project source_ax12 which has a model TaxTrans.
  • project databricks_dwh which imports project source_ax12 as package and has a model TaxTrans itself.

When I parse the project, I get the error that the model TaxTrans exist twice.

Only option I can work around myself is renaming TaxTrans in the databricks_dwh project to something else and use a alias. But this is not something I want to do. Sub projects should not mess up my main project model naming(!) And to adjust the sub project doesn't make much sence to me. Then I mess up the model naming there. I want to have consistent, clear naming in the projects themselve.

Expected Behavior

I would expect that the parsing works out and that dbt by default let the TaxTrans model in the databricks_dwh win. It should only redirect to the TaxTrans of the source_ax12 project when I reference to it explicitly.

Steps To Reproduce

  1. create a project like described above
  2. run dbt parse

Relevant log output

dbt.log

�[0m08:26:10.446302 [info ] [MainThread]: Manifest loaded
�[0m08:26:10.458008 [debug] [MainThread]: Sending event: {'category': 'dbt', 'action': 'invocation', 'label': 'end', 'context': [<snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x7fe7b80dca90>, <snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x7fe7b80dc490>, <snowplow_tracker.self_describing_json.SelfDescribingJson object at 0x7fe7b80dc3a0>]}
�[0m08:26:10.458492 [debug] [MainThread]: Flushing usage events
�[0m08:26:11.061893 [error] [MainThread]: Encountered an error:
Compilation Error
  dbt found two models with the name "TaxTrans".
  
  Since these resources have the same name, dbt will be unable to find the correct resource
  when looking for ref("TaxTrans").
  
  To fix this, change the name of one of these resources:
  - model.databricks_dwh.TaxTrans (models/Finance/TaxTrans.sql)
  - model.source_ax12.TaxTrans (models/source_ax12/TaxTrans.sql)

Environment

- OS: Debian 11
- Python: 3.9.2
- dbt: 1.4.1

Which database adapter are you using with dbt?

spark

Additional Context

No response

@leo-schick leo-schick added bug Something isn't working triage labels Feb 10, 2023
@github-actions github-actions bot changed the title [Bug] duplicate model conflict with sub projects [CT-2077] [Bug] duplicate model conflict with sub projects Feb 10, 2023
@jtcohen6 jtcohen6 added the duplicate This issue or pull request already exists label Feb 10, 2023
@jtcohen6
Copy link
Contributor

@leo-schick Thanks for opening! I share your instincts about what's desirable here.

This is a quite old issue:

The good news is, we're planning to (finally) tackle that work, a few months from now, as part of a larger initiative:

In the meantime, I'm going to close this as a duplicate of #1269.

@jtcohen6 jtcohen6 closed this as not planned Won't fix, can't repro, duplicate, stale Feb 10, 2023
@jtcohen6 jtcohen6 removed the triage label Feb 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working duplicate This issue or pull request already exists
Projects
None yet
Development

No branches or pull requests

2 participants