Open tatiana opened 4 months ago
I was about to raise an issue about this and found this ticket. We're having an issue with dbt relationship testing while using DbtTaskGroup
operator.
Let's say we have two models model1
and model2
, where model2
references model1
. We define relationship test on model2
column column1
referencing model1
.column1
.
When we run a dag with DbtTaskGroup selecting these 2 models. Tests for model1
will fail, because model2
doesn't exist. Cosmos will run the relationship test twice -- in testing nodes for each of the models.
Changing test_indirect_selection
option in ExecutionConfig()
doesn't help, because each Airflow task node only selects one dbt model, so test_indirect_selection
doesn't really apply here.
When using dbt build
command, this will work correctly, because dbt
will execute relationship test only once after both model1
and model2
were run.
@kzajaczkowski do you think you may be able to contribute with this feature? We could aim to release it in the next Cosmos release, if so!
@tatiana, thank you, but unfortunately, I wouldn't be able to contribute at this time.
Original discussion in: https://github.com/astronomer/astronomer-cosmos/pull/751#issuecomment-1878578854
Cosmos can improve its implementation towards tests with multiple parents - we should make it consistent with dbt.