Hi <@U08982U8DFF>! I noticed that elementary model...
# community-support
m
Hi @Elementary Support! I noticed that elementary models are built every time I run the "dbt run" command. I'm in the process of increasing the run frequency and am wondering if I can remove this from my micro-batch runs. My question is: can I remove the lines of code below (granted that I have built the elementary models at least once in prod)?
Copy code
5 of 167 START sql incremental model elementary.dbt_exposures .................. [RUN]
08:15:52  6 of 167 START sql incremental model elementary.dbt_invocations ................ [RUN]
08:15:52  3 of 167 START sql incremental model elementary.data_monitoring_metrics ........ [RUN]
08:15:52  7 of 167 START sql incremental model elementary.dbt_metrics .................... [RUN]
08:15:52  8 of 167 START sql incremental model elementary.dbt_models ..................... [RUN]
08:15:52  9 of 167 START sql incremental model elementary.dbt_run_results ................ [RUN]
08:15:52  10 of 167 START sql incremental model elementary.dbt_seeds ..................... [RUN]
08:15:52  11 of 167 START sql incremental model elementary.dbt_snapshots ................. [RUN]
08:15:52  12 of 167 START sql incremental model elementary.dbt_source_freshness_results .. [RUN]
08:15:52  13 of 167 START sql incremental model elementary.dbt_sources ................... [RUN]
08:15:52  14 of 167 START sql incremental model elementary.dbt_tests ..................... [RUN]
08:15:52  15 of 167 START sql incremental model elementary.elementary_test_results ....... [RUN]
08:15:52  4 of 167 START sql incremental model elementary.dbt_columns .................... [RUN]
08:15:52  16 of 167 START sql table model elementary.metadata ............................ [RUN]
r
Hi Mihail 🙂 We use this when we don't want to run elementary models
dbt run --exclude package:elementary
🙌 1
m
That's great, thanks! Could you please shed some light on when you run and don't run your elementary models?
r
Looks like we only actually include elementary in our
dbt run
when Elementary has been updated and the table schemas may have changed. Outside of that scenario, the dbt run metadata gets updated in the Elementary tables as part of the on-run-end hook We also only have Elementary enabled in prod, so none of the on-run-start/end hooks run in development. In dbt_project.yml:
Copy code
elementary:
    +schema: "elementary"
    +enabled: "{{ target.name in ['prod'] }}"
    +docs:
      show: false
🙌 1
t
Thought I would just chime in with what we setup for ours. We have it only run on target of prod but also included a variable option so that for prod related things we could specifically turn it off with
--vars "enable_elementary: false"
Copy code
elementary:
    +schema: "elementary"
    +enabled: "{{ target.name == 'prod' and var('enable_elementary', true) }}"
🙌 2