Metacenta

BI semantic layer · rule lookml-view-reads-raw-source

Looker views reading raw dbt sources

A Metacenta review checks this under the rule A BI view reads a model, not a raw source. Everything below applies whether or not you ever commission one.

What this rule checks

Among Looker views over a table the dbt project knows, this rule flags those reading a table dbt only declares as a source. A name that is both a source and a built model passes, because that is a staging model named after its source.

Why it matters

Deduplication, renaming, type fixes and the tests that prove them all happen in models this view skips. Two dashboards can then disagree about one figure, one reading the model and one the raw table.

How to fix it

Move Looker views off raw sources onto dbt models. Point the view at the model built from the source. If the BI layer needs the raw rows, build a thin staging model for it, so tests and lineage cover what it reads.

Before:

view: payments {
  sql_table_name: raw_stripe.charges ;;
}

After:

view: payments {
  sql_table_name: analytics.stg_stripe__charges ;;
}

When it is fine to leave

A view used only to inspect what landed, such as a load-monitoring page for the data team. Keep it out of business explores. Everything a business user reads should come through a model.

What we need to check it

The .lkml files and manifest.json. Without a manifest the rule declines. Views over a table dbt does not know are not judged here, because the question has no answer for them. We match on the table's name, not its schema.