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

When dbt encounters two sources with the same name, it crashes with an exception #2463

Closed
beckjake opened this issue May 15, 2020 · 1 comment
Assignees
Labels
bug Something isn't working

Comments

@beckjake
Copy link
Contributor

Describe the bug

When dbt hits a duplicate source, it crashes with a bad error about 'UnpatchedSourceDefinition' object has no attribute 'source_name'.

Steps To Reproduce

  1. Define a source and a table
  2. Define the table a second time (either in a new source with the same name or a second table in the original source)
  3. dbt compile.
version: 2
sources:
 - name: my_source
   tables:
    - name: foo
    - name: foo

Expected behavior

I should get this error:

  dbt found two resources with the name "my_source_foo". Since these resources have the same name,
  dbt will be unable to find the correct resource when source("my_source", "foo") is used. To fix this,
  change the name of one of these resources:
  - source.minimal.my_source.foo (models/schema.yml)
  - source.minimal.my_source.foo (models/schema.yml)

This happens on any db, any python, dbt 0.17.0rc1

@beckjake beckjake added bug Something isn't working triage labels May 15, 2020
@beckjake beckjake added this to the Octavius Catto milestone May 15, 2020
@beckjake beckjake self-assigned this May 15, 2020
@drewbanin drewbanin removed the triage label May 15, 2020
@beckjake
Copy link
Contributor Author

Fixed in #2464

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