Forcing Dependencies -- depends_on example code


Could you please help with an example for Forcing Dependencies – depends_on
I checked “Forcing Dependencies” section in the below DBT documentation link, but it doesn’t have a clear example.

Please help.


Hi Gauresh,

The example shown in dbt Docs as a comment is actually the way the dependency is hinted to the compiler. That is, in order to let dbt know an implicit dependency in the model you’re creating, you simply have to add the following line somewhere at the top of your model sql file.

-- depends_on: {{ ref('upstream_parent_model') }}

I hope that helps!