0
0
dbtdata~5 mins

dbt-utils package tests - Cheat Sheet & Quick Revision

Choose your learning style9 modes available
Recall & Review
beginner
What is the purpose of the dbt-utils package in dbt?
The dbt-utils package provides a collection of useful macros and tests that simplify common data transformation and testing tasks in dbt projects.
Click to reveal answer
beginner
Name one common test provided by dbt-utils and explain its use.
The unique_combination_of_columns test checks that the combination of specified columns in a model is unique, ensuring no duplicate rows based on those columns.
Click to reveal answer
intermediate
How do you add dbt-utils tests to your dbt project?
You add dbt-utils as a package in your packages.yml file, run dbt deps to install it, then reference its tests in your model's schema.yml file.
Click to reveal answer
beginner
What does the dbt_utils.not_null_proportion test check for?
It checks that the specified column(s) in a model have at least a minimum proportion of non-NULL values (e.g., 1.0 for no NULLs), ensuring data completeness.
Click to reveal answer
intermediate
Explain how the dbt_utils.expression_is_true test works.
This test runs a SQL expression you provide and checks that it evaluates to true for all rows in the model, allowing custom validation logic.
Click to reveal answer
Which file do you update to add dbt-utils as a dependency?
Aschema.yml
Bdbt_project.yml
Cprofiles.yml
Dpackages.yml
What does the unique_combination_of_columns test ensure?
AThe combination of specified columns is unique
BColumns have unique values individually
CNo NULL values in columns
DColumns contain only numeric data
Which command installs the dbt-utils package after adding it to packages.yml?
Adbt deps
Bdbt run
Cdbt test
Ddbt compile
What does the not_null_proportion test check in dbt-utils?
AThat columns have unique values
BThat columns have default values
CThat columns do not contain NULL values
DThat columns contain only numbers
How do you specify a dbt-utils test in your model's schema.yml?
ABy writing SQL queries in the model file
BBy adding a <code>tests</code> section with the test name and arguments
CBy modifying <code>dbt_project.yml</code>
DBy running <code>dbt test</code> without configuration
Describe the steps to add and use a dbt-utils test in your dbt project.
Think about package installation and test configuration.
You got /4 concepts.
    Explain the difference between the not_null_proportion and unique_combination_of_columns tests in dbt-utils.
    Focus on what each test validates about the data.
    You got /3 concepts.