Running Elementary Tests and Generate Reports
Elementary CLI Setup
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.
1. Install the Elementary CLI
1. Install the Elementary CLI
Run one of the following commands based on your platform:
Install Elementary CLI
To install the monitor module run:
Run one of the following commands based on your platform (no need to run all):
Run edr --help
in order to ensure the installation was successful.
If you're receiving command not found: edr
please check our troubleshooting guide.
2. Creating a Profile for the CLI
2. Creating a Profile for the CLI
Configuring the Elementary Profile
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):
Ensure that you fill in your password and any other missing fields after you
paste the profile in your local profiles.yml
file.
Copy the output, fill in the missing fields and add the profile to your profiles.yml
.
Here is a demonstration:
Elementary profile details and format
- Path:
HOME_DIR/.dbt/profiles.yml
- Profile name:
elementary
- Schema name: The schema of elementary models, default is
<your_dbt_project_schema>_elementary
Running Elementary
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:
Note: Here we are setting the anomalies flag to False - only seeding valid data to our DWH.
Your First Test
Now that we have populated our data warehouse with valid data, we will run our tests and ensure that everything passes:
All of our tests (except the dbt project’s example tests) should pass. Now, let’s visualize our results:
You’ve just run your first Elementary report!
Let’s get real though…
Data is rarely perfect. Let’s get real and add some more data to our project:
Now let’s run our tests again:
Now we should see our Elementary tests fail! Now let’s visualize this failure:
Congratulations!
Congratulations, you successfully configured Elementary’s tests and ran the report!
For additional information and help, you can use one of these channels:
-
Slack (live chat with the team, community support, discussions, etc.)
-
GitHub (bug reports, feature requests, contributions)
-
📧 Contact us directly at [email protected]
Any feedback would be highly appreciated 🤗