Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updates to Model Contracts (v1.5 betas) #3100

Merged
merged 10 commits into from
Mar 30, 2023

Conversation

jtcohen6
Copy link
Collaborator

resolves #2945
resolves #3023

What are you changing in this pull request and why?

Updates to docs on Model Contracts based on changes in:

  • v1.5.0-b4 (released on March 16)
  • v1.5.0-b5 (released planned for Thursday, March 30)

Plus, some updates to the v1.5 upgrade guide. We should give this a full once-over before the RC on April 13, including links out to other related documentation changes.

cc @MichelleArk @matthewshaver I'm going to take another pass (later) in the morning :)

@github-actions github-actions bot added content Improvements or additions to content guides Knowledge best suited for Guides labels Mar 29, 2023
@netlify
Copy link

netlify bot commented Mar 29, 2023

Deploy Preview for docs-getdbt-com ready!

Name Link
🔨 Latest commit 0b47c02
🔍 Latest deploy log https://app.netlify.com/sites/docs-getdbt-com/deploys/6425895e814cd30008a8bcee
😎 Deploy Preview https://deploy-preview-3100--docs-getdbt-com.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

@github-actions github-actions bot added the size: large This change will more than a week to address and might require more than one person label Mar 29, 2023
@jtcohen6 jtcohen6 mentioned this pull request Mar 29, 2023
4 tasks
Copy link
Collaborator Author

@jtcohen6 jtcohen6 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@matthewshaver I think this is ready for editorial review. There's one TODO that's really missing, which is proactively documenting some known limitations/caveats for constraints (things we chose to kick out of scope / not prioritize).


### For maintainers of adapter plugins

Coming soon: GH discussion detailing interface changes and offering a forum for Q&A
For more detailed information and to ask any questions, please visit [dbt-core/discussions/6624](https://github.com/dbt-labs/dbt-core/discussions/6624).
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Stealing from #3052 - no reason to delay getting this info live

@@ -53,9 +56,9 @@ More to come!
:::

### Publishing models as APIs
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some of the nomenclature here is liable to change, as we go through formal internal naming process. No updates just yet / for this PR; I expect to be ready with those updates before the RC (April 13).

```

## Example
## Support
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a more-positive spin on "Limitations" :) but if you think that's a clearer way of expressing it, we can switch out one for the other (or for something else)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks good. Always more pleasing to the reader to put a positive spin on anything. "Don't apologize for keeping them waiting; thank them for their patience" type of experience.

website/docs/reference/resource-configs/contract.md Outdated Show resolved Hide resolved
website/docs/reference/resource-configs/contract.md Outdated Show resolved Hide resolved
Comment on lines 11 to 12
- `type`: one of `not_null`, `primary_key`, `foreign_key`, `check`, `custom`
- `expression`: text input to qualify the constraint
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

- `type` (required): one of `not_null`, `primary_key`, `foreign_key`, `check`, `custom`
- `expression`: text input to qualify the constraint; required for certain constraint types, and optional for others
- `name` (optional): some data platforms support defining constraints with a human-friendly name

website/docs/reference/resource-properties/constraints.md Outdated Show resolved Hide resolved
To that end, there are two optional fields you can specify on any constraint:
- `warn_unenforced: False` to skip warning on constraints that are supported, but not enforced, by this data platform. The constraint will be included in templated DDL.
- `warn_unsupportedL: False` to skip warning on constraints that aren't supported by this data platform, and therefore won't be included in templated DDL.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TODO: document the limitations called out in #2945 (comment)

  • no ref support for foreign_key / references constraints
  • no standard support (yet) for platform-specific rely instructions, unless implemented for that platform specifically
  • no support for schema evolution in incremental models - adding/removing constraints as the column spec changes, during incremental runs

@jtcohen6 jtcohen6 marked this pull request as ready for review March 29, 2023 15:12
@jtcohen6 jtcohen6 requested a review from a team as a code owner March 29, 2023 15:12
@matthewshaver matthewshaver merged commit 652662c into current Mar 30, 2023
@matthewshaver matthewshaver deleted the jerco/v1.5-b4-b5-model-contracts branch March 30, 2023 13:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
content Improvements or additions to content guides Knowledge best suited for Guides size: large This change will more than a week to address and might require more than one person
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Update multi-project docs for v1.5.0-b5 (March 30) Update multi-project docs for v1.5.0-b4 (March 16)
2 participants