Skip to content

Commit

Permalink
Selector inheritance #1628
Browse files Browse the repository at this point in the history
  • Loading branch information
jtcohen6 committed Jul 14, 2022
1 parent cb11d5c commit 8afd0ff
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,6 @@ See GitHub discussion [dbt-labs/dbt-core#5468](https://github.com/dbt-labs/dbt-c

- **[Grants](/reference/resource-configs/grants)**: You should now manage access to the datasets you're producing with dbt by using grants instead of using hooks. If you already use post-hook to apply simple grants, moving to the grants feature will allow you to [DRY](https://en.wikipedia.org/wiki/Don%27t_repeat_yourself) up your duplicated or boilerplate code.
- **[dbt-Jinja functions](reference/dbt-jinja-functions)** now include the [`itertools` Python module](dbt-jinja-functions/modules#itertools), as well as the [set](dbt-jinja-functions/set) and [zip](dbt-jinja-functions/zip) functions.
- **[Node selection](node-selection/syntax)** includes a [file selection method](node-selection/methods#the-file-method) (`-s model.sql`)
- **[Node selection](node-selection/syntax)** includes a [file selection method](node-selection/methods#the-file-method) (`-s model.sql`), and [yaml selector](node-selection/yaml-selectors) inheritance.

https://github.com/dbt-labs/docs.getdbt.com/labels/dbt-core%20v1.2
28 changes: 28 additions & 0 deletions website/docs/reference/node-selection/yaml-selectors.md
Original file line number Diff line number Diff line change
Expand Up @@ -261,3 +261,31 @@ selectors:
default: "{{ target.name == 'prod' | as_bool }}"
definition: ...
```

<VersionBlock firstVersion="1.2">

### Selector inheritance

Selectors can reuse and extend definitions from other selectors, via the `selector` method.

```yml
selectors:
- name: foo_and_bar
definition:
intersection:
- tag: foo
- tag: bar

- name: foo_bar_less_buzz
definition:
intersection:
# reuse the definition from above
- method: selector
value: foo_and_bar
# with a modification!
- exclude:
- method: tag
value: buzz
```
</VersionBlock>

0 comments on commit 8afd0ff

Please sign in to comment.