Skip to content

Commit

Permalink
dbt-bigquery supports and enforces primary key constraints (#4419)
Browse files Browse the repository at this point in the history
### Previews
- [Terms: Primary key - Data warehouse support for primary
keys](https://docs-getdbt-com-git-dbeatty-bigquery-primary-ke-d59f0b-dbt-labs.vercel.app/terms/primary-key#data-warehouse-support-for-primary-keys)
- [Model contracts: Platform constraint
support](https://docs-getdbt-com-git-dbeatty-bigquery-primary-ke-d59f0b-dbt-labs.vercel.app/docs/collaborate/govern/model-contracts#platform-constraint-support)

## What are you changing in this pull request and why?

@bnaul called out
[here](dbt-labs/dbt-bigquery#865 (comment))
that some
[documentation](https://docs.getdbt.com/terms/primary-key#google-bigquery)
isn't in alignment with the [source
code](https://github.com/dbt-labs/dbt-bigquery/blob/64e042a2349f17342f7af96d559e4e3a5138a49e/dbt/adapters/bigquery/impl.py#L115)
(which asserts that dbt-bigquery supports and enforces primary key
constraints).

Here are some other docs that should all be in alignment, but aren't:

### Model contracts: Platform constraint support


https://docs.getdbt.com/docs/collaborate/govern/model-contracts#platform-constraint-support

<img width="500" alt="image"
src="https://github.com/dbt-labs/docs.getdbt.com/assets/44704949/5cd7e1f6-7c82-4c82-b07c-0bfdd9e4a032">

### constraints: Platform-specific support


https://docs.getdbt.com/reference/resource-properties/constraints#platform-specific-support

<img width="500" alt="image"
src="https://github.com/dbt-labs/docs.getdbt.com/assets/44704949/046c732a-6262-4290-952a-a24cbdf76ead">

## Checklist
- [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.
- [x] I've checked that the preview renders correctly
- [ ] I've checked that that code behaves as described
  • Loading branch information
mirnawong1 authored Nov 16, 2023
2 parents 520c5a2 + b195e05 commit 5ac11fb
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions website/docs/docs/collaborate/govern/model-contracts.md
Original file line number Diff line number Diff line change
Expand Up @@ -125,8 +125,8 @@ Select the adapter-specific tab for more information on [constraint](/reference/
| Constraint type | Support | Platform enforcement |
|:-----------------|:-------------|:---------------------|
| not_null | ✅ Supported | ✅ Enforced |
| primary_key | ✅ Supported | ✅ Enforced |
| foreign_key | ✅ Supported | ✅ Enforced |
| primary_key | ✅ Supported | ❌ Not enforced |
| foreign_key | ✅ Supported | ❌ Not enforced |
| unique | ❌ Not supported | ❌ Not enforced |
| check | ❌ Not supported | ❌ Not enforced |

Expand Down
2 changes: 1 addition & 1 deletion website/docs/terms/primary-key.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ The table below gives an overview of primary key support and enforcement in some
<tr>
<td><a href="https://docs.getdbt.com/blog/primary-key-testing#bigquery-primary-keys">Google BigQuery</a>
</td>
<td>
<td>
</td>
<td>❌
</td>
Expand Down

0 comments on commit 5ac11fb

Please sign in to comment.