Paths/Data Engineer/Data Transformations / Models & Projects
Lay Out the Project
The project file decides where the models live and which profile they run with. Write it.
Validator
IDLE — checks run live as you type commands; submit when done
01Requirements
live checks- Directory ~/dbt exists○
- File ~/dbt/dbt_project.yml exists○
- The config names the project, the profile and the model paths○
- The config states the materialisation strategy○
02Walkthrough
4 steps- 01
Create the dbt directory
The project root holds the configuration and the models.
mkdir -p ~/dbt - 02
Write the project config
name identifies the project, profile names the connection, and model-paths says where the SQL lives.
echo 'name: acme_orders\nversion: 1.0.0\nconfig-version: 2\nprofile: warehouse_dev\nmodel-paths: ["models"]\nseed-paths: ["seeds"]\ntest-paths: ["tests"]' > ~/dbt/dbt_project.yml - 03
State the materialisation strategy
Staging models are views, because they are cheap and always read from the source. The marts are tables, because everything downstream reads them.
echo '\nmodels:\n acme_orders:\n materialized: table\n staging:\n materialized: view' >> ~/dbt/dbt_project.yml - 04
Verify and submit
cat the config, then submit for validation.
cat ~/dbt/dbt_project.yml
03Stuck?
0 of 3 revealedTake a hint without losing the lab — each one points at the thing to look at, not at the answer.
04AI Tutor
guides, never solvesTell me what you're stuck on — I'll nudge, not solve. Which requirement are you looking at?
04Notebook
saved locally in this browserlearner@lab — ubuntu:24.04
Session is disposable
↑/↓ recalls commands · Ctrl+Enter submits · type help for the command list