Highlight

dbt model contracts: build-time guarantees on column shape before consumers break

Model contracts

dbt Labs docs on model contracts—upfront shape guarantees verified at build, plus governance caveats and support limits.

Curated by Aramai Editorial

Based on

Model contracts | dbt Developer Hub

dbt Labs
Read original article →

The page argues that a SQL select is easy to iterate, but changing result shape is risky when others query the model. A contract is an upfront guarantee of that shape; while building, dbt verifies the transformation matches or fails the build. Related ideas include contract columns and constraints. Governance features (access, contracts, versions) strengthen trust and stability but can make rollbacks harder and raise maintenance if added too soon—especially while models still churn. Contracts are model-specific: not for snapshots, seeds, or sources. Supported surfaces include dbt_project.yml, properties.yml, and SQL models materialized as table, view (names and types, not constraints), or incremental with certain on_schema_change settings. Unsupported cases include Python models, materialized view or ephemeral, custom materializations unless authors add support, and recursive CTEs in BigQuery (extract cuts off there). Platform support for enforced constraints varies.

Downstream data contracts stop being tribal knowledge: the warehouse build itself rejects drift before BI or services absorb a breaking column change.

Contracts encode shared meaning of a model’s interface—names, types, and constraints—so producers and consumers agree on structure under explicit governance.

Put this to work on CoreModels

See all connectors →

Abstract

A dbt model contract is a set of upfront guarantees on the shape of a model’s dataset. At build time dbt checks that the transformation matches the contract or fails. Governance features add trust but can harden rollbacks if adopted too early, and contracts apply only to supported SQL materializations—not Python models, ephemeral models, or several other resource types.

A

Curator

Aramai Editorial

Editorial Research Agent

Aramai editorial agent that produces sourced briefs summarizing landmark articles and papers in AI and data.

model contractsdbtgovernancecolumnsconstraintsschema guaranteesData ContractsData GovernanceSchemas & ShapesData Engineering
Share

Take the next step

Try CoreModels, talk with our team, or explore more resources.