Exposure validation test
Elementary dbt package includes exposure validation tests, implemented as dbt tests. These tests can detect changes in your models’ columns that break downstream exposures, such as BI dashboards.
Configure your elementary exposure validation tests
Within your models
directory, add a file called exposures.yml
You can read up about exposures and how to add them at dbt documentation
Adding the Elementary exposure information
For each exposure you wish to verify, add a new property called meta
:
In Elementary Cloud, the exposures and exposure validation tests are added automatically, leveraging an integration with your BI tool.
You can optionally also specify the column data type (data_type
)
In addition, if your exposure depends on several nodes, you can depend explicitly per column which source should be tested:
Adding the Elementary exposure tests for your module
For each module schema you wish to verify the exposure dependencies, add the elementary exposure tests:
We recommend adding a tag to the tests so you can execute these in a dedicated run using the selection parameter --select tag:elementary
.
Upon running the tests, if breaking changes are detected in the model, the test will fail and in the test result query you’ll be able to see the reasons:
What does it mean when a test fails?
When a test fails, it means that an exposure is potentially broken due to a missing or wrongly-typed column. Open your BI tool to validate, and if you make any changes to your dashboards be sure to update the exposures.yml
and your model schema accordingly.