Good morning,
I am trying to post this using the correct posting rules, but this is my first post here and I apologize if my post is not formatted correctly.
I have looked for this on the internet, but I have not been able to find a solution. Maybe I was not searching correctly.
The problem I’m having
Oftentimes I find myself trying to apply a graph operator (+, @) on a select statement that is created from an intersection of two or more statements.
For instance, if I want to run all models that depend on sources tagged “br”, I would like to do:
dbt run --select (source:*,tag:br)+
In this example, downstream models are not sources nor are they necessarily tagged br.
Moreover, there might be downstream models tagged:br that do not depend on sources (e.g. they depend on seeds) and thus would not be included in tag:br+,source:*+
The context of why I’m trying to do this
This happens very often in my day to day: I want to run a part of the DAG starting from some specific models. For unions it is very simple as: (A B)+ = A+ B+.
However, for intersections this does not work.
What I’ve already tried
When I have this issue I either run more models than I need or I have to specify each and every model.
For production data, we have already improved the tags so that we can simply select the tags, but during development it is very useful if we can run only the models we want.
Is there a solution to this issue?
Ideally we could do things like:
dbt run -s ((tag:de tag:nl),(config.materialized:incremental,tag:sales))+
dbt test -s @(tag:daily,tag:ru)
Etcetera.
Thank you very much!