YAML selectors
YAML selectors allow you to define and manage complex asset selection criteria in a single selectors.yml
file. Storing selectors improves code readability by allowing the reuse of complex asset selection statements across your Y42 space. Moreover, selectors are version-controlled using your space's Git repository, ensuring they remain synchronized with your build history.
Create and use YAML selectors
Create a selectors file
In Code Editor mode, create a new selectors.yml
file in the project's root directory. This file must be place at the top-level of your Y42 project, alongside dbt_project.yml
.
- dbt_project.yml
- selectors.yml
Define your selectors
Define your selectors in the selectors.yml
file with the following properties:
- name (required)
- description (optional)
- definition (required) - Write all asset selection logic within this YAML key.
Utilize a selector
Once you've committed the selectors.yml
file to the space's Git repository, you can apply a selector using the --selector
command flag.