Hi all! Our team is implementing Elementary on our...
# general
m
Hi all! Our team is implementing Elementary on our dbt project. I was wondering if there was a way to enable the elementary configurations and default tests on entire schemas / folders of models rather than having to copy the same configurations into every individual model
yml
file or config block?
o
Hi @Mariah Rogers! 👋 currently the monitors are defined as tests and unfortunately dbt doesn't support at the moment a way to define tests globally on entire schemas or folders. Another issue with defining monitors globally is that it's really recommended from performance perspective to define a timestamp_column that is used for both freshness calculations and limiting the amount of data that is being scanned.
A possible workaround that was suggested in the dbt's community was to use YAML anchors to possibly reduce the configuration work -
That being said, we are actively researching creative ways to better support this use case and would love to explore them with you 🙂. A followup question we had about it - do you have a generic name for your timestamp columns across different tables / models?
j
@Mariah Rogers This was the original thread in dbt slack https://getdbt.slack.com/archives/C2JRRQDTL/p1649955100718789
@Or Avidov Mariah is a colleague of mine 🙂 - the vast majority of our timestamps are
updated_at
- it'd be great to set that as a variable in dbt, while retaining the ability to override the config on a per-model/source basis as needed (using the current syntax)
Thinking along the same lines, what if elementary tested all models by default with the ability to disable or configure a subset of monitors as configuration? Switching the config to opt-out instead of opt-in would reduce initial setup time-cost, though it might be a little unconventional
o
Yeah it makes sense. We have an idea on how this could be done using a new type of test that will run on multiple tables instead of one table / column. We could create a global model in our package and you can create its yml file and define these new tests on this model. The main downside would be that when there is an issue with one of the tables / columns this global test will fail and you will only be able to understand which table / column has an issue in the slack alerts / alerts table that is being saved in the DWH
🤔 1
We can mitigate this downside with logs by printing to the screen while running the tests which tables / columns are problematic