What's the difference between the `disable_dbt_art...
# ask-elementary-ai
a
What's the difference between the
disable_dbt_artifacts_autoupload
variable and setting
Copy code
edr: {+enabled: "{{ var('enable_elementary_models', false) }}"}
k
A message from kapa.ai
Based on the knowledge sources, I can explain the difference between
disable_dbt_artifacts_autoupload
and the
edr
CLI approach: ## Key Differences
disable_dbt_artifacts_autoupload
variable:
- This variable disables the automatic upload of dbt artifacts (project metadata like
dbt_models
,
dbt_tests
,
dbt_sources
, etc.) during the
on-run-end
hook - When set to
true
, the hook will still upload run results and test results from each dbt invocation - You need to manually run
dbt run --select elementary.edr.dbt_artifacts
to update the artifacts when your project changes
edr
CLI approach:
- When you run
edr
(for monitoring or reporting) from your dbt project directory, it automatically uploads the dbt artifacts before generating reports or sending alerts - This creates an overlap with the hook's artifact upload functionality ## Recommended Setup According to [a discussion about concurrent runs](https://slack.com/archives/C02CTC89LAX/p1672966052599339), the recommended approach is: 1. Set
disable_dbt_artifacts_autoupload: true
in your
dbt_project.yml
2. Let
edr
handle the artifact uploads when you run monitoring/reporting 3. The
on-run-end
hook continues to upload run results and test results from each invocation This setup reduces load on your dbt invocations while keeping the hooks lean, as explained in [this thread about reducing hook overhead](https://slack.com/archives/C02CTC89LAX/p1672966052599339). The artifacts (project metadata) don't need to be uploaded on every invocation since they only change when your project structure changes, while run/test results are specific to each invocation.
a
@kapa.ai I meant the project config
edr: {+enabled: "{{ var('enable_elementary_models', false) }}"}
. I want to disable the models from being updated during runs without impacting the update for test results
k
A message from kapa.ai
Based on the knowledge sources, I can clarify the difference between disabling Elementary models with
edr: +enabled
and using the disable variables for hooks: ## Key Differences Disabling Elementary models (
edr: +enabled: false
):
- Prevents Elementary models from being created/updated during
dbt run
- According to [this Slack discussion](https://slack.com/archives/C02CTC89LAX/p1673628649610999), when you disable the package using
enabled: false
, the hooks are disabled and models are not created - This means test results will NOT be collected because the hooks won't function properly without the underlying models Using disable variables (recommended approach): - Variables like
disable_run_results
,
disable_tests_results
,
disable_dbt_artifacts_autoupload
, and
disable_dbt_invocation_autoupload
control what the hooks upload - According to [the same discussion](https://slack.com/archives/C02CTC89LAX/p1673628649610999), using these vars "will disable the
on-run-end
hook upload. The package models will still be part of your
dbt run
, and will be empty as there is no hook running to load data into them." ## Your Use Case If you want to disable model updates but keep test results collection, the knowledge sources indicate this creates a problem. As explained in [this thread](https://slack.com/archives/C02CTC89LAX/p1669625539486519), when Elementary models are disabled with
+enabled: false
, it causes issues with test results collection. The [recommended approach from the FAQ](https://docs.elementary-data.com/oss/general/faq) is to: 1. Keep Elementary models enabled but exclude them from regular runs using
--exclude elementary
2. Run Elementary models explicitly only when needed (after installation or upgrades) Alternatively, you can use the var-based approach:
Copy code
yaml models:   elementary:     +schema: elementary     edr:       +enabled: "{{ var('enable_elementary_models', false) }}"
Then run:
dbt run --select elementary --vars '{"enable_elementary_models": true}'
only when upgrading. However, the hooks will still work to collect test results even when models are disabled this way, as long as the models exist in your warehouse from a previous run.
a
@kapa.ai So if I have disabled the
edr
module path then the run results and test results will still be uploaded?
k
A message from kapa.ai
Based on the knowledge sources, I need to clarify an important point about disabling the
edr
module path: ## The Issue with Disabling Elementary Models According to [this Slack discussion](https://slack.com/archives/C02CTC89LAX/p1680689840547609), when Elementary is set to
enabled: false
, "it's like it is no longer installed in your project. Nothing will work on runs when it's disabled - the results logging, the tests, the metadata collection." Similarly, [another discussion](https://slack.com/archives/C02CTC89LAX/p1673628649610999) confirms that when you disable the package using
enabled: false
, "the hooks are disabled and models are not created." ## The Answer to Your Question No, if you disable the
edr
module path with
+enabled: false
, the run results and test results will NOT be uploaded.
The
on-run-end
hooks depend on the Elementary package being enabled to function properly. ## The Recommended Solution According to [the FAQ](https://docs.elementary-data.com/oss/general/faq), if you want to prevent Elementary models from running during regular
dbt run
commands while still collecting results, you should: 1. Keep the models enabled but exclude them from runs using
--exclude elementary
2. Use the disable variables to control hook behavior if needed:
Copy code
yaml vars:   disable_run_results: "{{ target.name != 'prod' }}"   disable_tests_results: "{{ target.name != 'prod' }}"   disable_dbt_artifacts_autoupload: "{{ target.name != 'prod' }}"   disable_dbt_invocation_autoupload: "{{ target.name != 'prod' }}"
This way, the hooks will continue to work and collect results, but you control when the Elementary models themselves are updated.
a
<!subteam^S08HYBWCF6E> Is this accurate? It's not particularly clear to me from the previous threads and the docs whether it's intentional that disabling the
edr
block should prevent the run/test results from being updated.
👀 1
n
Hey @Alex Richardson !
disable_dbt_artifacts_autoupload: true
→ Prevents the hook from attempting uploads; models can still be run manually.
edr: {+enabled: false}
→ Disables the models entirely; the hook may still run but will skip uploads if tables don't exist, and you cannot run the models manually. Let me know if this makes sense.
a
Thanks Noya. So if I were to build the
elementary
models, then set
edr: {+enabled: false}
, then build the project again, the expected behaviour would be for the elementary hooks to still insert records to the results tables?