Skip to content

Commit

Permalink
The "plus" graph operator also selects the model itself (#4861)
Browse files Browse the repository at this point in the history
[Preview](https://docs-getdbt-com-git-dbeatty-plus-operator-dbt-labs.vercel.app/reference/node-selection/graph-operators)

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

resolves #3979 by updating the description of the "plus" graph operator
from:

> If placed at the front of the model selector, + will select all
parents of the selected model. If placed at the end of the string, +
will select all children of the selected model.

to:

> If placed at the front of the model selector, + will select all
parents of the selected model and the model itself. If placed at the end
of the string, + will select all children of the selected model and the
model itself.

as discussed in
dbt-labs/dbt-core#8340 (comment).

## Checklist
- [x] Review 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.
  • Loading branch information
mirnawong1 authored Feb 6, 2024
2 parents b90d372 + 9739d04 commit 4e945de
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions website/docs/reference/node-selection/graph-operators.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@ title: "Graph operators"
---

### The "plus" operator
If placed at the front of the model selector, `+` will select all parents of the selected model. If placed at the end of the string, `+` will select all children of the selected model.
If placed at the front of the model selector, `+` will select all parents of the selected model and the model itself. If placed at the end of the string, `+` will select all children of the selected model and the model itself.


```bash
dbt run --select "my_model+" # select my_model and all children
dbt run --select "+my_model" # select my_model and all parents
dbt run --select "+my_model+" # select my_model, and all of its parents and children
dbt run --select "+my_model+" # select my_model, and all of its parents and children
```


Expand All @@ -22,7 +22,7 @@ to step through.
```bash
dbt run --select "my_model+1" # select my_model and its first-degree children
dbt run --select "2+my_model" # select my_model, its first-degree parents, and its second-degree parents ("grandparents")
dbt run --select "3+my_model+4" # select my_model, its parents up to the 3rd degree, and its children down to the 4th degree
dbt run --select "3+my_model+4" # select my_model, its parents up to the 3rd degree, and its children down to the 4th degree
```


Expand All @@ -32,5 +32,5 @@ The `@` operator is similar to `+`, but will also include _the parents of the ch
<Lightbox src="/img/docs/running-a-dbt-project/command-line-interface/1643e30-Screen_Shot_2019-03-11_at_7.18.20_PM.png" title="@snowplow_web_page_context will select all of the models shown here"/>

```bash
dbt run --models @my_model # select my_model, its children, and the parents of its children
dbt run --models @my_model # select my_model, its children, and the parents of its children
```

0 comments on commit 4e945de

Please sign in to comment.