If I place a reference to some model X in a the post hook statement to model Y. Will model Y’s DAG also point to model X?
I tested it here and yes, it will assume they are dependent
model1.sql
select 1
model2.sql
{{ config(
post_hook = "select * from {{ ref('model1') }}"
) }}
select 2
❯ dbt run -s +model2
13:05:29 Running with dbt=1.7.3
13:05:29 Registered adapter: postgres=1.7.3
13:05:30 Found 8 models, 1 snapshot, 35 tests, 1 seed, 3 sources, 0 exposures, 0 metrics, 663 macros, 0 groups, 0 semantic models
13:05:30
13:05:30 Concurrency: 4 threads (target='dev')
13:05:30
13:05:30 1 of 2 START sql view model dbt_bruno.model1 ................................... [RUN]
13:05:30 1 of 2 OK created sql view model dbt_bruno.model1 .............................. [CREATE VIEW in 0.09s]
13:05:30 2 of 2 START sql view model dbt_bruno.model2 ................................... [RUN]
13:05:30 2 of 2 OK created sql view model dbt_bruno.model2 .............................. [CREATE VIEW in 0.05s]
13:05:30
13:05:30 Finished running 2 view models in 0 hours 0 minutes and 0.31 seconds (0.31s).
13:05:30
13:05:30 Completed successfully
13:05:30
13:05:30 Done. PASS=2 WARN=0 ERROR=0 SKIP=0 TOTAL=2