Skip to content

Commit

Permalink
Update incremental-models.md (#6739)
Browse files Browse the repository at this point in the history
update conditions for is_incremental() to evaluate to true based on
Issue 5279

## What are you changing in this pull request and why?
<!--
Describe your changes and why you're making them. If related to an open
issue or a pull request on dbt Core or another repository, 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).
-->
This update is to address [Issue 5279 - Understand the is_incremental()
macro](#5279)

I believe the original intent of the first two conditions was to say:
"the model has to exist as a table" however saying this using two lines
feels redundant and I know from training sessions that users react much
the same way as the author of this issue.

I'm proposing the following wording:

Revised

The `is_incremental()` macro powers incremental materializations. It
will return `True` if _all_ of the following conditions are met:

- The model must already exist _as a table_ in the database
- The `full-refresh` flag _is not_ passed
- The running model is configured with `materialized='incremental'`

Original (for reference)

The `is_incremental()` macro powers incremental materializations. It
will return `True` if _all_ of the following conditions are met:

- The model must already exist in the database
- The destination table already exists in the database
- The `full-refresh` flag _is not_ passed
- The running model is configured with `materialized='incremental'`

## Checklist
- [x] I have reviewed the [Content style
guide](https://github.com/dbt-labs/docs.getdbt.com/blob/current/contributing/content-style-guide.md)
so my content adheres to these guidelines.
- [ ] The topic I'm writing about is for specific dbt version(s) and I
have versioned it according to the [version a whole
page](https://github.com/dbt-labs/docs.getdbt.com/blob/current/contributing/single-sourcing-content.md#adding-a-new-version)
and/or [version a block of
content](https://github.com/dbt-labs/docs.getdbt.com/blob/current/contributing/single-sourcing-content.md#versioning-blocks-of-content)
guidelines.
- [ ] I have added checklist item(s) to this list for anything anything
that needs to happen before this PR is merged, such as "needs technical
review" or "change base branch."
- [ ] The content in this PR requires a dbt release note, so I added one
to the [release notes
page](https://docs.getdbt.com/docs/dbt-versions/dbt-cloud-release-notes).
<!--
PRE-RELEASE VERSION OF dbt (if so, uncomment):
- [ ] Add a note to the prerelease version [Migration
Guide](https://github.com/dbt-labs/docs.getdbt.com/tree/current/website/docs/docs/dbt-versions/core-upgrade)
-->
<!-- 
ADDING OR REMOVING PAGES (if so, uncomment):
- [ ] Add/remove page in `website/sidebars.js`
- [ ] Provide a unique filename for new pages
- [ ] Add an entry for deleted pages in `website/vercel.json`
- [ ] Run link testing locally with `npm run build` to update the links
that point to deleted pages
-->

<!-- vercel-deployment-preview -->
---
🚀 Deployment available! Here are the direct links to the updated files:


-
https://docs-getdbt-com-git-datapackdan-patch-issue-5279-dbt-labs.vercel.app/docs/build/incremental-models

<!-- end-vercel-deployment-preview -->
  • Loading branch information
datapackdan authored Jan 8, 2025
1 parent d242456 commit 495a66d
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions website/docs/docs/build/incremental-models.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,7 @@ To use incremental models, you also need to tell dbt:

The `is_incremental()` macro powers incremental materializations. It will return `True` if _all_ of the following conditions are met:

- The model must already exist in the database
- The destination table already exists in the database
- The model must already exist as a table in the database
- The `full-refresh` flag _is not_ passed
- The running model is configured with `materialized='incremental'`

Expand Down

0 comments on commit 495a66d

Please sign in to comment.