dbt-labs/dbt-core

[Bug] Exposures can't reference private model

dat-a-ish opened this issue · 1 comments

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

Exposure cannot reference a private model although it could in the 1.6 version.
Exposure definition:

- name: "test_dashboard"
  label: "Test Dashboard"
  type: dashboard
  maturity: medium

  depends_on:
    - ref('private_model')

  owner:
    name: Egor Tarasenko

dbt ls returns the following output:

Parsing Error
  Node exposure.psdw_rs.test_dashboard attempted to reference node model.psdw_rs.private_model, which is not allowed because the referenced node is private to the 'private_group' group.

Expected Behavior

Referencing a private model in exposure doesn't rise an error

Steps To Reproduce

  1. install dbt-core, dbt-redshift >= 1.7
  2. Create a private model
  3. Reference it from Exposure:
- name: "test_dashboard"
  label: "Test Dashboard"
  type: dashboard
  maturity: medium

  depends_on:
    - ref('private_model')

  owner:
    name: Egor Tarasenko
  1. Run: dbt ls

Relevant log output

Parsing Error
  Node exposure.psdw_rs.test_dashboard attempted to reference node model.psdw_rs.private_model, which is not allowed because the referenced node is private to the 'private_group' group.

Environment

- Python: 3.10
- dbt: dbt-core==1.7 dbt-redshift==1.7

Which database adapter are you using with dbt?

redshift

Additional Context

No response

@dat-a-ish Thanks for opening - I'm going to close this as a duplicate of:

While it doesn't feel like a recommended practice to reference a private model within an exposure — that model is definitionally not meant to be an interface for external consumption — it should still be possible. Similar to referencing a source within an exposure: not encouraged, but possible.