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

Select resources with the source resource_type #4145

Merged
merged 4 commits into from
Sep 28, 2023
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion website/docs/reference/node-selection/methods.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,13 +47,19 @@ The `source` method is used to select models that select from a specified [sourc
```

### The "resource_type" method
Use the `resource_type` method to select nodes of a particular type (`model`, `source`, `exposure`, etc). This is similar to the `--resource-type` flag used by the [`dbt ls` command](/reference/commands/list).
Use the `resource_type` method to select nodes of a particular type (`model`, `test`, `exposure`, etc). This is similar to the `--resource-type` flag used by the [`dbt ls` command](/reference/commands/list).
mirnawong1 marked this conversation as resolved.
Show resolved Hide resolved

```bash
$ dbt build --select resource_type:exposure # build all resources upstream of exposures
$ dbt list --select resource_type:test # list all tests in your project
```

Note: This method doesn't work for sources, so use the [`--resource-type`](/reference/commands/list) option of the list command instead:

```bash
$ dbt list --resource-type source
```

### The "path" method
The `path` method is used to select models/sources defined at or under a specific path.
Model definitions are in SQL/Python files (not YAML), and source definitions are in YAML files.
Expand Down