Hey is the `dbt_models` table meant to continuousl...
# community-support
k
Hey is the
dbt_models
table meant to continuously add and remove tables? Depending on when we query it during the day sometimes our models are there and sometimes they are completely gone
➕ 1
s
@Ella Katz This seems like the same behaviour that we're experiencing.
k
I think I've figured out what the problem is. We have a 3 dbt project setup: •
bronze project
•
silver project
•
gold project
the
silver project
imports the
bronze project
and the
gold project
imports the
silver project
(and in turn also
bronze project
) but it's a one-direction import so the
bronze project
has no idea of the
silver project
and
gold project
and the
silver project
has no idea of the
gold project
we run elementary on-run-end hooks for all three projects towards the same dataset. So my best guess so far is that: • when we run models in the
bronze project
the on-run-end hooks will overwrite the
dbt_models
table with only models from the
bronze project
• when we run models in the
silver project
the on-run-end hooks will overwrite the
dbt_models
table with only models from the
bronze project
and
silver project
• when we run models in the
gold project
the on-run-end hooks will overwrite the
dbt_models
table with only models from the
bronze project
and
silver project
and
gold project
so depending on which project was run last we wither get all models or only a subset. It would be nice if there's a solution to this, it's really helpful for us to have everything in the same project (also for our edr reports and monitoring) but we don't want to run everything from the
gold project
e
Hi @Kasper Ramström, Yeah that's exactly what would happen if you use multiple envs writing to the same elementary schema. We have an open Github issue about it and we are looking into this. @Sindre Grindheim do you think this is caused by the same issue in your case?
🙌 1
s
@Ella Katz No, we write to separate environment specific elementary schemas, so that seems like a different scenario.
e
OK continuing on your thread then 🙏🏼
👍 1