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

Adding new state selectors #3596

Merged
merged 10 commits into from
Jul 6, 2023
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 @@ -200,6 +200,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

The primary benefit of these selectors is to exclude unchanged nodes to shorten run times. No subselectors are available at this time, but that may change as use cases evolve.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
The primary benefit of these selectors is to exclude unchanged nodes to shorten run times. No subselectors are available at this time, but that may change as use cases evolve.
These selectors can help you shorten run times by excluding unchanged nodes. Currently, no subselectors are available at this time.

matthewshaver marked this conversation as resolved.
Show resolved Hide resolved

</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