Running a tag with seeds and sources

I’m trying to create a test tag that would run the following:

  1. Two source tables from two different folders
  2. All seeds in a specific folder
  3. 5 transformation models

I used the following syntax:

For source tables:

sources:
  - name: source_name
    
    tables:
      - name: hist_table
        tags: ["my_tag"]

for seeds in dbt_project.yml:

seeds:
  project_name:
    folder_name:
      +tags: my_tag

(also tried +tags: "my_tag"

And for models in the yml file:

models:
  - name: my_model_1
     config:
       tags:  "my_tag"

The seeds or sources do not show up in the execution list when I use dbt run --select tag:my_tag. Anything I’m missing?

Seeds are not included in dbt run. You can either run dbt seed --select tag:my_tag first, or you could run dbt build --select tag:my_tag which will do everything (including execute tests; see build | dbt Developer Hub)

Sources themselves don’t need to be run because they already exist, do you mean that you want to build the models that those sources depend on? If so then you should use the + operator: dbt run --select tag:my_model+, but note that this will also build the downstream models from my_model_1 etc.

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.