Why do I need to enable something ?
By default, the Store won't materialize anything. You need to enable the models you want to materialize. We do this to avoid materializing data you don't need : if you are interested by only one dashboard of the store, then you don't need to materialize the whole core_dashboards_store.
How to enable a resource ?
Resource schould be understand as a set of tables required by a dashboard, as a whole mart or as a unique
.sql
file.
+enabled: True|False
is a DBT's mechanism to enable and disable resources. You schould read the DBT's documentation to learn more about it. It also works for tests and seeds.Enabling a model is done throught the cssXX.dashboards_store/dbt_project.yml
file. To enable a model, simply open the dbt_project.yml
file, find the name of the resource you wan't to enable, and switch the +enabled: false
key to +enabled: true
.
Exemple
Enabling a mart
I have added my seeds to the human resources mart and now want to enable it.
- I first open my
cssXX.dashboards_data/dbt_project.yml
and look for thehuman_resources
resource. I find the following :
models:
core_dashboards_store:
marts:
human_resources:
+enabled: False
- I then toogle the
+enabled: False
to+enabled: True
:
models:
core_dashboards_store:
marts:
human_resources:
+enabled: True
- ...aaaaand it's done.
Enabling a dashboard
Let's say I wan to enable the chronic_absenteism
dashboard
- I first open my
cssXX.dashboards_data/dbt_project.yml
and look for thechronic_absenteism
resource. I find the following :
models:
core_dashboards_store:
dashboards:
chronic_absenteeism:
+enabled: False
- I then toogle the
+enabled: False
to+enabled: True
:
models:
core_dashboards_store:
dashboards:
chronic_absenteeism:
+enabled: True
Enabling an interface
Let's say I need to enable the paie
interface to materialize the HR mart.
- I first open my
cssXX.dashboards_data/dbt_project.yml
and look for thepaie
resource. I find the following :
models:
core_dashboards_store:
interfaces:
paie:
+enabled: False
vars:
database_paie: "replaceMeWithYourDatabase"
- I then replace the
database_paie
variable with the name of my database (refer to the linking a database section for more information) :
vars:
database_paie: "dataServer.paie" # The database's name in the warehouse. It will be interpolated in the Interface layer.
- I then toogle the
+enabled: False
to+enabled: True
:
models:
core_dashboards_store:
interfaces:
paie:
+enabled: True
vars:
database_paie: "dataServer.paie"
Between resources dependencies
A common error, is to enable a model without enabling it's dependencies :
- For marts, it means enabling a mart, without enabling the
interfaces
it depends on. - For a dashboard it means enabling a dashboard without enabling the marts it's built upon.