Skip to content

Commit

Permalink
Adding new state selectors (#3596)
Browse files Browse the repository at this point in the history
## What are you changing in this pull request and why?

Adding the `state:unmodified` and `state:old` selectors

## 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] 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 Jul 6, 2023
2 parents bb16477 + b030eb9 commit 1ab4799
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions website/docs/reference/node-selection/methods.md
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,16 @@ Because state comparison is complex, and everyone's project is different, dbt su
Remember that `state:modified` includes _all_ of the criteria above, as well as some extra resource-specific criteria, such as modifying a source's `freshness` or `quoting` rules or an exposure's `maturity` property. (View the source code for the full set of checks used when comparing [sources](https://github.com/dbt-labs/dbt-core/blob/9e796671dd55d4781284d36c035d1db19641cd80/core/dbt/contracts/graph/parsed.py#L660-L681), [exposures](https://github.com/dbt-labs/dbt-core/blob/9e796671dd55d4781284d36c035d1db19641cd80/core/dbt/contracts/graph/parsed.py#L768-L783), and [executable nodes](https://github.com/dbt-labs/dbt-core/blob/9e796671dd55d4781284d36c035d1db19641cd80/core/dbt/contracts/graph/parsed.py#L319-L330).)
<VersionBlock firstVersion="1.6">
There are two additional `state` selectors that complement `state:new` and `state:modified` by representing the inverse of those functions:
- `state:old` &mdash; A node with the same `unique_id` exists in the comparison manifest
- `state:unmodified` &mdash; All existing nodes with no changes
These selectors can help you shorten run times by excluding unchanged nodes. Currently, no subselectors are available at this time, but that might change as use cases evolve.
</VersionBlock>
### The "exposure" method
The `exposure` method is used to select parent resources of a specified [exposure](/docs/build/exposures). Use in conjunction with the `+` operator.
Expand Down

0 comments on commit 1ab4799

Please sign in to comment.