dbt Setup Guide

Local dbt Core installation and configuration

title: “dbt Setup Guide” subtitle: “Local dbt Core installation and configuration” —

TipUsing GitHub Codespaces?

dbt Core, dbt-databricks, and dbt-snowflake are pre-installed in the devcontainer. Skip the installation section below and go straight to Configure profiles.yml.

Install dbt Core

Using pip (fallback)

# pip install dbt-core dbt-databricks dbt-snowflake

Verify Installation

dbt --version
# Should show dbt Core 1.8.x or later
# Plus adapters: dbt-databricks, dbt-snowflake

Configure Profiles

Step 1: Copy the Example

cd dbt_project/
cp profiles.yml.example profiles.yml

Step 2: Edit profiles.yml

Fill in your credentials for at least one target:

Snowflake Target

mhp_de_workshop:
  target: snowflake
  outputs:
    snowflake:
      type: snowflake
      account: "your-account-id"          # From your trial signup
      user: "your-username"
      password: "your-password"
      warehouse: "DE_WORKSHOP_WH"
      database: "DE_MASTERCLASS"
      schema: "{{ env_var('ATTENDEE_ID', '01_alice') }}_SILVER"
      threads: 4

Databricks Target

    databricks:
      type: databricks
      host: "adb-xxxxxxxxxxxx.xx.azuredatabricks.net"
      http_path: "/sql/1.0/warehouses/xxxxxxxxxxxxxxxx"
      token: "dapixxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
      catalog: "mhpdeworkshop_databricks_2026"
      schema: "{{ env_var('ATTENDEE_ID', '01_alice') }}_silver"
      threads: 4

Step 3: Set Environment Variable

# Linux/Mac
export ATTENDEE_ID="01_alice"

# Windows PowerShell
$env:ATTENDEE_ID = "01_alice"

# Windows CMD
set ATTENDEE_ID=01_alice

Step 4: Verify Connection

dbt debug
# Should show "All checks passed!"

First Run

# Install packages (dbt_utils)
dbt deps

# Load seed data (taxi zone lookup)
dbt seed

# Run all models
dbt run

# Run tests
dbt test

# Generate and view documentation
dbt docs generate
dbt docs serve

Project Structure

dbt_project/
├── dbt_project.yml           # Project configuration
├── profiles.yml              # Your credentials (git-ignored)
├── packages.yml              # Dependencies (dbt_utils)
├── models/
│   ├── staging/              # Views wrapping raw Bronze tables
│   ├── silver/               # Cleaned + enriched tables
│   └── gold/                 # 12 KPI aggregation tables
├── macros/                   # Reusable SQL functions
├── seeds/                    # CSV data loaded as tables
└── production/               # CI/CD examples (not run locally)

Troubleshooting

Issue Solution
dbt debug fails Check profiles.yml credentials
“No source” error Ensure Bronze tables exist (run Databricks or Snowflake pipeline first)
Snowflake auth error Verify account ID format: abc12345.west-europe.azure
Databricks token error Generate new token: Databricks → Settings → Access Tokens
dbt deps fails Check internet connection; verify packages.yml format
Schema not found Verify ATTENDEE_ID env var is set

Tips

  • Use dbt run --select model_name to run a single model
  • Use dbt run --select silver+ to run all Silver models + downstream
  • Use dbt compile to see generated SQL without executing
  • Check target/compiled/ for the actual SQL sent to the database