Exclude multiple tags

I have a project in which we’re trying to deprecate a few directories. To do this, we’ve gone through and tagged models in one directory with “tagname_a”. In another directory we tagged models with “tagname_b”.

If I run dbt run --exclude tag:tagname_a, I can see that those models do not run.

If I run dbt run --exclude tag:tagname_b, I can see that those models do not run.

However, if I run dbt run --exclude tag:tagname_a,tag:tagname_b, all of the models run and nothing gets excluded.

What is the proper syntax to run dbt and exclude multiple tags?

We’re on dbt version 1.3. Any help would be appreciated. Thank you.

the comma in the node selector syntax means you select the intersection of those two tags, i.e. models that are tagged with tagname_a and with tagname_b. if you want to exclude tagname_a and tagname_b individually then leave a whitespace in the dbt command:
dbt run --exclude tag:tagname_a tag:tagname_b

Note: @Paul P (Target Reply) originally posted this reply in Slack. It might not have transferred perfectly.

2 Likes

Thank you for the reply, that’s exactly what I needed.

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