Skip to content

Commit

Permalink
Update model-contracts.md for supported models (#4336)
Browse files Browse the repository at this point in the history
## What are you changing in this pull request and why?
<!---
Describe your changes and why you're making them. If linked to an open
issue or a pull request on dbt Core, then link to them here! 

To learn more about the writing conventions used in the dbt Labs docs,
see the [Content style
guide](https://github.com/dbt-labs/docs.getdbt.com/blob/current/contributing/content-style-guide.md).
-->

Update to show that incremental models with on_schema_change: fail are
actually supported (only on_schema_change: append_new_columns is
mentioned but this was changed here
dbt-labs/dbt-core#8006)

Reformatted the list to make it clearer what is and isn't supported.

## Checklist
<!--
Uncomment if you're publishing docs for a prerelease version of dbt
(delete if not applicable):
- [ ] Add versioning components, as described in [Versioning
Docs](https://github.com/dbt-labs/docs.getdbt.com/blob/current/contributing/single-sourcing-content.md#versioning-entire-pages)
- [ ] Add a note to the prerelease version [Migration
Guide](https://github.com/dbt-labs/docs.getdbt.com/tree/current/website/docs/guides/migration/versions)
-->
- [x] Review the [Content style
guide](https://github.com/dbt-labs/docs.getdbt.com/blob/current/contributing/content-style-guide.md)
and [About
versioning](https://github.com/dbt-labs/docs.getdbt.com/blob/current/contributing/single-sourcing-content.md#adding-a-new-version)
so my content adheres to these guidelines.
- [ ] Add a checklist item for anything that needs to happen before this
PR is merged, such as "needs technical review" or "change base branch."
  • Loading branch information
matthewshaver authored Jan 8, 2024
2 parents f1a4b1d + 3807a54 commit 515840b
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions website/docs/docs/collaborate/govern/model-contracts.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,18 @@ While this is ideal for quick and iterative development, for some models, consta
## Where are contracts supported?

At present, model contracts are supported for:
- SQL models. Contracts are not yet supported for Python models.
- Models materialized as `table`, `view`, and `incremental` (with `on_schema_change: append_new_columns`). Views offer limited support for column names and data types, but not `constraints`. Contracts are not supported for `ephemeral`-materialized models.
- SQL models.
- Models materialized as one of the following:
- `table`
- `view` &mdash; Views offer limited support for column names and data types, but not `constraints`.
- `incremental` &mdash; with `on_schema_change: append_new_columns` or `on_schema_change: fail`.
- Certain data platforms, but the supported and enforced `constraints` vary by platform.

Model contracts are _not_ supported for:
- Python models.
- `ephemeral`-materialized SQL models.


## How to define a contract

Let's say you have a model with a query like:
Expand Down

0 comments on commit 515840b

Please sign in to comment.