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

[regression] Defining properties for model + exposure with same name raises exception #2969

Closed
jtcohen6 opened this issue Dec 19, 2020 · 0 comments · Fixed by #3009
Closed
Assignees
Labels
bug Something isn't working

Comments

@jtcohen6
Copy link
Contributor

Describe the bug

dbt raises the exception raise_duplicate_patch_name when an exposure and a model have the same name:

https:/fishtown-analytics/dbt/blob/ce6967d396f6723f44ad8d5efb058c760f27d167/core/dbt/parser/results.py#L156-L158

I've confirmed that this exception is not raised by v0.18.1 or v0.19.0-b1 (the version we released on Oct 22), but it is raised when I install dbt from the current development branch dev/kiyoshi-kuromiya.

Steps To Reproduce

Create a model and an exposure with the same name, and define resource properties for both:

version: 2

models:
  - name: metrics
    description: My metrics model

exposures:
  - name: metrics
    type: dashboard
    description: My metrics dashboard
    depends_on:
      - ref('metrics')
    owner:
      email: [email protected]

Try running any command, e.g. dbt compile:

  dbt found two schema.yml entries for the same resource named metrics. Resources and their associated columns may only be described a single time. To fix this, remove one of the resource entries for metrics in this file:
   - models/metrics/schema.yml

Expected behavior

Since exposures are not included in the set of nodes (models, seeds, snapshots, tests) but rather their own resource type (like sources), it should be possible to define properties for an exposure and a model with the same name.

Otherwise, this will be a breaking change in v0.19.0.

The output of dbt --version:

$ dbt --version
installed version: 0.19.0-b1

i.e. current development version in dev/kiyoshi-kuromiya

@jtcohen6 jtcohen6 added the bug Something isn't working label Dec 19, 2020
@jtcohen6 jtcohen6 added this to the Kiyoshi Kuromiya milestone Dec 19, 2020
@kwigley kwigley self-assigned this Jan 7, 2021
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

Successfully merging a pull request may close this issue.

2 participants