The CLI tool allows users to generate reports and visuallize results based on the tests we just configured. While we have already added the Elementary packages to our dbt project, the Elementary CLI requires a separate installation, as it is a Python tool.
Important: Both dbt Cloud and dbt Core users will need to run the Elementary
CLI locally. If you are a cloud user, you will need to ensure your
configuration has met all the prerequisites.
Run one of the following commands based on your platform:
In order to connect, Elementary needs a connection profile in a file named profiles.yml.
This profile will be used by the CLI, to connect to the DWH and find the dbt package tables.
The easiest way to generate the profile is to run the following command within the dbt project where you deployed the elementary dbt package (works in dbt cloud as well):
Now that we have added Elementary tests to our schemas.yml file, it’s time to run our first tests. We begin by running on a subset of our data that is all valid:
dbt run --vars "{'anomalies': False}"
Note: Here we are setting the anomalies flag to False - only seeding valid data to our DWH.