Graph Operators

Graph operators in dbt are special syntax used with the --select flag to target specific parts of your project's execution graph (DAG). This graph represents the dependencies between your models, with each model as a node and the dependencies as edges.

The graph operators allow you to navigate this execution graph and select subsets of your project's resources. They're like secret codes to tell dbt exactly which models you want to work with, whether it's running, testing, or listing them.

Operators

Wildcard Operator (*)

Run all models in a schema.

Path Operator

No special character needed, just use the path.

Parent/Child Operator (+)

The plus before a model name selects the model and its parents. The plus after a model name selects the model and its children.

Exclusion Operator (@)

Select parents or children, without the original model.

Selection Operator (,)

Run multiple models.

Intersection Operator (,)

Get the intersection of multiple selectors.

Pro Tips

  • Combine operators for laser-focused selection:

  • Use dbt ls to preview your selection:

  • Refresh two generations of parents and all children of critical models:

  • Test everything related to final reports except the reports themselves:

  • Remember, the order of operators matters, as dbt processes them from left to right.

With these graph operators, you can create powerful, precise dbt commands to execute exactly the models you need in your data transformation pipelines.

Last updated

Was this helpful?