Defining and Working With dbt Tests

Lab Steps

lock
Understanding dbt Tests
lock
Connecting to the dbt Web IDE
lock
Defining dbt Tests on Sources
lock
Creating a Custom dbt Test
lock
Adding dbt Tests to Models
lock
Performing dbt Tests and Executing the Models

The hands-on lab is part of this learning path

Ready for the real environment experience?

DifficultyAdvanced
Time Limit1h 15m
Students18
Ratings
5/5
starstarstarstarstar

Description

When working with data, you want to be sure that specific requirements and standards are satisfied by your data. When transforming and modeling the data, having a tool that automatically tests the output data could be a good solution in order to have high-quality data.

Testing is a core component when working with data, so dbt allows you to test your sources and models. You can use native dbt tests, but you can also define your own.

In this lab step, you will test your dbt sources. You will then create a custom test, and test a model both with native and custom dbt tests.

Learning Objectives

Upon completion of this lab, you will be able to:

  • Understand what tests are and how to work with tests
  • Create custom dbt tests

Intended Audience

  • Data analysts that need to test the dbt output produced
  • Developers that need to create custom dbt tests

Prerequisites

To get the most from this lab, you should have basic knowledge of dbt. To get ready, you can use the following labs:

About the Author
Students26609
Labs106
Courses2
Learning paths8

Stefano studies Computer Science and is passionate about technology. He loves working with Cloud services and learning all the best practices for them. Google Cloud Platform and Amazon Web Services are the cloud providers he prefers. He is a Google Cloud Certified Associate Cloud Engineer. Node.js is the programming language he always uses to code. When he's not involved in studying or working, Stefano loves riding his motorbike and exploring new places.