Metacenta

Modelling correctness · rule exposure-on-private-model

dbt exposures on access: private models

A Metacenta review checks this under the rule Exposures read models that declare themselves public. Everything below applies whether or not you ever commission one.

What this rule checks

This rule flags exposures that read a model declared access: private. Models that are public, protected or carry no access setting pass. If no model in the project declares access, the rule declines.

Why it matters

The project has reserved the right to change a private model without notice, yet a dashboard depends on it. A refactor nobody thought was breaking will then break the dashboard.

How to fix it

Build exposures only on models declared public. Promote the model to access: public and treat it as an interface, or point the exposure at a model that already is public.

Before:

models:
  - name: int_order_totals
    access: private
    group: finance

After:

models:
  - name: fct_order_totals
    access: public
    group: finance
    config:
      contract:
        enforced: true

When it is fine to leave

A dashboard owned by the team that owns the private model, and changed in step with it, carries less risk. Promoting the model to public is still the clearer statement.

What we need to check it

manifest.json alone. A project with no exposures is not judged here. Before dbt 1.5 no model can declare access, so the rule says it could not assess.

Published rules it corresponds to

dbt_project_evaluator, rule fct_exposures_dependent_on_private_models. Ours checks the same condition and threshold.

This means our check corresponds to their rule. It does not mean the publisher reviewed or endorses it.