Courses/Data/dbt From Zero, Part 3: Sources & Freshness
Shadab Barmare

dbt From Zero, Part 3: Sources & Freshness

Declare CocoaCo’s raw tables as dbt sources, point your models at them with source() and add freshness checks that warn you when data stops arriving. Part 3 of the dbt From Zero series.

Free lesson·2h 50m·Data

What you'll learn

What a dbt source is and why models shouldn't read raw tables by name

Declaring raw tables in a sources.yml file

Pointing models at raw data with source() and reading the compiled SQL

Adding freshness rules with loaded_at_field, warn_after and error_after

Running dbt source freshness and reading PASS, WARN and ERROR STALE

Fixing models that use source() the wrong way

Syllabus

Lab 2 — Sources & freshness
  • •Concept: What is a source?
  • •Guided walkthrough: declare your first source
  • •Lab 2 Challenge: Label the whole pantry
  • •Lab 2 Quiz
Feedback & Certificate
  • •Course Feedback (Required for Certificate)

What's included

Certificate of completion

Complete every lesson and the short feedback form to download your CtrlSkill certificate

Course material

1 lab: 2 lessons, 1 hands-on challenge, 1 quiz (about 3 hours)

Prerequisites

  • •Completed Part 2, "dbt From Zero, Part 2: Project Anatomy & Your First Models"
  • •The cocoaco_dbt project and the cocoaco.duckdb file from Part 2 on your computer
  • •Reading a basic SQL query with GROUP BY
  • •About 3 hours

Who is this for?

  • •Data analysts who write SQL and want to build reliable data pipelines
  • •Students and career changers moving into data analytics or analytics engineering
  • •BI developers who want to understand how the data behind their dashboards is built