Metacenta

Lineage integrity · rule model-possibly-unused

dbt leaf models with no declared exposure

A Metacenta review checks this under the rule Leaf models are consumed by something. Everything below applies whether or not you ever commission one.

What this rule checks

This rule flags dbt models that no other model reads and that no exposure, metric or semantic model declares as a consumer. It runs only when the project declares at least one of those three, and declines otherwise. Superseded model versions are left out. So is a MetricFlow time spine, when the project has a semantic layer.

Why it matters

If nothing reads a leaf model, it costs build time and warehouse storage for no return. A dashboard that reads it without a declared exposure looks identical, so we report the finding at low confidence.

How to fix it

Declare exposures for leaf models, or retire them. Declare an exposure for each dashboard or application that reads the model. Drop the model if nothing does.

Before:

models:
  - name: fct_orders
    description: One row per order.

After:

models:
  - name: fct_orders
    description: One row per order.

exposures:
  - name: weekly_revenue
    type: dashboard
    owner:
      name: Finance analytics
    depends_on:
      - ref('fct_orders')

When it is fine to leave

A mart read only by a BI tool, in a team that does not yet declare exposures, is the common case. The gap is then a missing declaration, not waste. We rate it low severity in a marts or reporting folder for that reason, and medium elsewhere.

What we need to check it

manifest.json alone, which dbt parse writes. We list the superseded versions and time spines we left out, so the exclusion is visible rather than silent.