Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
bc1f7f2
Update requirements.in to operate on dbt-core 1.7
QMalcolm Mar 11, 2024
479a5d5
Regenerate `requirements.txt` to use dbt-core 1.7 and related depende…
QMalcolm Mar 11, 2024
9b13827
Merge pull request #55 from dbt-labs/qmalcolm--CVE-2024-22195-exclude…
QMalcolm Mar 20, 2024
f51b08d
Finish implementing initial support for DuckDB
gwenwindflower Apr 14, 2024
9746b8b
Revert "Finish implementing initial support for DuckDB"
gwenwindflower Apr 14, 2024
46d939b
Updating requirements.txt
matthewshaver Jun 5, 2024
d860542
Update requirements.txt
matthewshaver Jun 5, 2024
a2a5628
Update requirements.txt
matthewshaver Jun 5, 2024
026b12f
Merge pull request #62 from dbt-labs/requirements
matthewshaver Aug 20, 2024
2a1db9e
Create CODEOWNERS file with global codeowner
security-dbtlabs Jan 21, 2025
85046ad
Merge pull request #73 from dbt-labs/codeowners-create
Cr0n1c Feb 4, 2025
74c9480
Change SQLFluff dialect
esadek Mar 24, 2025
682b356
Merge pull request #80 from esadek/dialect
joellabes Mar 25, 2025
80447e4
Add DuckDB UI to Readme (#81)
cadbox1 Mar 26, 2025
b98d2ad
Upgrade to latest dbt-duckdb and duckdb versions (#75)
guenp Apr 14, 2025
def2ee2
simplify extension startup (#83)
dataders May 5, 2025
10a96ce
Pin GitHub Actions to specific SHAs (10 actions in 1 files)
ddk-dbt Oct 31, 2025
8d715f3
Merge pull request #85 from dbt-labs/pin-github-actions-1761944130921
ddk-dbt Nov 7, 2025
d1437a1
fixed bad link
walter9388 Jan 6, 2026
db6bffa
Merge pull request #87 from walter9388/bugfix-bad-overview-repo-link
joellabes Jan 6, 2026
f5e92e3
Move to Python 3.13
pgoslatara Feb 6, 2026
3890477
Merge pull request #89 from pgoslatara/python-3.13
b-per Feb 6, 2026
a33c52a
Add design doc for expanded jaffle shop (~99 nodes)
danyelf Feb 24, 2026
0d0204c
Add seed generation script and 9 new seed CSV files
danyelf Feb 24, 2026
81a1c2e
Add 9 new staging models for expanded jaffle shop
danyelf Feb 24, 2026
f407740
Add 5 intermediate product domain models
danyelf Feb 24, 2026
b0b565f
Add 5 intermediate order domain models
danyelf Feb 24, 2026
81a8d66
Add 5 intermediate customer domain models
danyelf Feb 24, 2026
89f5afd
Add 10 intermediate models for store, supply chain, and review domains
danyelf Feb 24, 2026
09be3ba
refactor: reorganize project with intermediate, marts, metrics layers
danyelf Feb 24, 2026
8eafbf2
Add 12 new customer and order mart models
danyelf Feb 24, 2026
49577cc
Add 20 new mart models: product, store, finance, and supply chain
danyelf Feb 24, 2026
8da3994
Add 15 metrics and reporting models
danyelf Feb 24, 2026
0e0385f
Add schema.yml files for intermediate and metrics layers
danyelf Feb 24, 2026
de50d60
brave new world
danyelf Feb 24, 2026
71be58f
Update seed data
danyelf Mar 5, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .devcontainer.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
// Update the VARIANT arg in docker-compose.yml to pick a Python version: 3, 3.8, 3.7, 3.6
{
"name": "dbt",
"dockerFile" : "Dockerfile",
Expand Down
1 change: 1 addition & 0 deletions .envrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
layout python venv
1 change: 1 addition & 0 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* @dbt-labs/dx
30 changes: 10 additions & 20 deletions .github/workflows/validate_on_platforms.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,9 @@ jobs:
name: Validate Getting Started works on macOS
runs-on: macos-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.8.x"
uses: actions/setup-python@7f4fc3e22c37d6ff65e88745f38bd3157c663f7c # actions/setup-python@v4
- name: Full Deploy Commands
run: |
python3 -m venv venv
Expand All @@ -35,11 +33,9 @@ jobs:
name: Validate Getting Started works on linux
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.8.x"
uses: actions/setup-python@7f4fc3e22c37d6ff65e88745f38bd3157c663f7c # actions/setup-python@v4
- name: Full Deploy Commands
run: |
python3 -m venv venv
Expand All @@ -59,11 +55,9 @@ jobs:
name: Validate Getting Started works on Linux PowerShell Core
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.8.x"
uses: actions/setup-python@7f4fc3e22c37d6ff65e88745f38bd3157c663f7c # actions/setup-python@v4
- name: Full Deploy Commands
run: |
python3 -m venv venv
Expand All @@ -83,11 +77,9 @@ jobs:
name: Validate Getting Started works on Windows PowerShell
runs-on: windows-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.8.x"
uses: actions/setup-python@7f4fc3e22c37d6ff65e88745f38bd3157c663f7c # actions/setup-python@v4
- name: Full Deploy Commands
run: |
python -m venv venv
Expand All @@ -107,11 +99,9 @@ jobs:
name: Validate Getting Started works on Windows cmd.exe
runs-on: windows-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.8.x"
uses: actions/setup-python@7f4fc3e22c37d6ff65e88745f38bd3157c663f7c # actions/setup-python@v4
- name: Full Deploy Commands
run: |
python -m venv venv
Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@

target/
dbt_packages/
dbt_internal_packages/
fs_internal_packages/
dbt_modules/
logs/
**/.DS_Store
Expand All @@ -9,3 +11,4 @@ venv/
env/
**/*.duckdb
**/*.duckdb.wal
target-base/
1 change: 1 addition & 0 deletions .python-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
3.13
2 changes: 1 addition & 1 deletion .sqlfluff
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
[sqlfluff]

dialect = ansi
dialect = duckdb
2 changes: 1 addition & 1 deletion .vscode/extensions.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@

// List of extensions which should be recommended for users of this workspace.
"recommendations": [
"innoverio.vscode-dbt-power-user",
"mechatroner.rainbow-csv",
"yzhang.markdown-all-in-one",
"redhat.vscode-yaml"
],
// List of extensions recommended by VS Code that should not be recommended for users of this workspace.
"unwantedRecommendations": [
"innoverio.vscode-dbt-power-user",

]
}
32 changes: 0 additions & 32 deletions .vscode/tasks.json

This file was deleted.

2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM mcr.microsoft.com/vscode/devcontainers/python:3.9
FROM mcr.microsoft.com/vscode/devcontainers/python:3.13

ARG USER_UID=1000
ARG USER_GID=$USER_UID
Expand Down
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ If you want an adrenaline rush from a process that used to take dbt newcomers `1
[Verified GitHub Action on dbt Performance](https://github.com/dbt-labs/jaffle_shop_duckdb/runs/7141529753?check_suite_focus=true#step:4:306)

## Running this project
Prerequisities: Python >= 3.5
Prerequisities: Python >= 3.13

### Mach Speed: No explanation needed

Expand Down Expand Up @@ -430,6 +430,7 @@ To get up and running with this project:

## Browsing the data
Some options:
- [DuckDB UI](https://duckdb.org/docs/stable/extensions/ui.html)
- [duckcli](https://pypi.org/project/duckcli/)
- [DuckDB CLI](https://duckdb.org/docs/installation/?environment=cli)
- [How to set up DBeaver SQL IDE for DuckDB](https://duckdb.org/docs/guides/sql_editors/dbeaver)
Expand Down
20 changes: 15 additions & 5 deletions dbt_project.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,16 +19,26 @@ clean-targets:

require-dbt-version: [">=1.0.0", "<2.0.0"]

seeds:
seeds:
+docs:
node_color: '#cd7f32'

models:
jaffle_shop:
materialized: table
+materialized: table
staging:
materialized: view
+materialized: view
+docs:
node_color: 'silver'
+docs:
node_color: 'gold'
intermediate:
+materialized: view
+docs:
node_color: '#4169E1'
marts:
+materialized: table
+docs:
node_color: 'gold'
metrics:
+materialized: table
+docs:
node_color: '#9370DB'
136 changes: 136 additions & 0 deletions docs/plans/2026-02-23-expanded-jaffle-shop-design.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,136 @@
# Expanded Jaffle Shop Design

**Date:** 2026-02-23
**Purpose:** Scale jaffle_shop_duckdb from 9 nodes to ~99 nodes for Recce demo/testing
**Approach:** Balanced e-commerce expansion (Approach 3)

## Goals

- ~100 dbt nodes with interesting interdependencies across 5 layers
- Diamond dependencies, fan-in/fan-out patterns for Recce lineage demos
- 2 incremental models (complex for Recce impact analysis)
- Interesting CTEs: recursive category hierarchy, RFM segmentation, window functions
- Keep DuckDB backend, keep existing models as foundation

## Seed Tables (12)

### Existing (unchanged)
| Seed | Rows | Schema |
|------|------|--------|
| raw_customers | 100 | id, first_name, last_name |
| raw_orders | 99 | id, user_id, order_date, status |
| raw_payments | 113 | id, order_id, payment_method, amount |

### New
| Seed | ~Rows | Schema |
|------|-------|--------|
| raw_products | 50 | id, name, category_id, price, cost, created_at |
| raw_categories | 10 | id, name, parent_category_id |
| raw_order_items | 250 | id, order_id, product_id, quantity, unit_price |
| raw_stores | 5 | id, name, city, state, opened_at |
| raw_employees | 30 | id, store_id, first_name, last_name, role, hired_at |
| raw_promotions | 15 | id, name, discount_type, discount_value, start_date, end_date |
| raw_order_promotions | 40 | order_id, promotion_id |
| raw_supply_orders | 60 | id, product_id, store_id, quantity, order_date, delivered_date |
| raw_reviews | 80 | id, order_id, product_id, customer_id, rating, review_date |

## Staging Layer (12 models, views)

One per seed. Rename columns, cast types, basic cleaning. Standard dbt staging pattern.

- stg_customers, stg_orders, stg_payments (existing)
- stg_products, stg_categories, stg_order_items, stg_stores, stg_employees
- stg_promotions, stg_order_promotions, stg_supply_orders, stg_reviews

## Intermediate Layer (25 models)

### Product domain (5)
- int_category_hierarchy: recursive CTE for category tree
- int_products_with_categories: products + full category path
- int_product_margins: margin = price - cost, margin %
- int_order_items_with_products: line items + product/category
- int_order_items_enriched: line items + margin data

### Order domain (5)
- int_order_totals: aggregate line items to order level
- int_order_payments_matched: payments matched to order totals, flag discrepancies
- int_orders_with_promotions: orders + discount data
- int_order_enriched: fan-in of totals + promotions + payment status
- int_daily_order_summary: **incremental** daily rollup

### Customer domain (5)
- int_customer_order_history: per-customer order stats
- int_customer_first_last_orders: first/last order dates (window functions)
- int_customer_payment_methods: payment method preferences
- int_customer_review_activity: review stats per customer
- int_customer_segments: **RFM segmentation CTE** with window functions

### Store & employee domain (4)
- int_store_employees_active: active employees per store
- int_store_order_assignments: orders assigned to stores
- int_store_revenue: revenue per store
- int_store_performance: revenue per employee, efficiency

### Supply chain (3)
- int_supply_order_costs: supply orders with costs
- int_inventory_movements: in (supply) vs out (sales) movements
- int_product_stock_levels: **incremental** running stock calculation

### Reviews (3)
- int_reviews_with_products: reviews + product/category
- int_product_ratings: avg rating, count per product
- int_promotion_effectiveness: promoted vs non-promoted order comparison

## Mart Layer (35 models, tables)

### Customer (8)
- customers (enhanced existing), customer_lifetime_value, customer_segments_final
- customer_retention, customer_acquisition, customer_360 (big fan-in)
- customer_cohorts, customer_review_summary

### Orders (7)
- orders (enhanced existing), order_items, order_returns
- order_discounts, order_fulfillment, order_payment_status, new_orders (existing)

### Products (6)
- products, product_performance, product_categories
- product_inventory, product_reviews, product_profitability

### Stores (5)
- stores, store_performance, store_staffing, store_inventory, store_rankings

### Finance (5)
- payments_fact, revenue_summary, promotion_roi, cost_analysis, gross_margin

### Supply chain (4)
- supply_orders_fact, supplier_lead_times, reorder_recommendations, inventory_health

## Reporting/Metrics Layer (15 models)

### Metrics (10)
- metric_daily_revenue, metric_daily_orders, metric_weekly_sales, metric_monthly_sales
- metric_customer_acquisition_monthly, metric_customer_retention_monthly
- metric_product_sales_daily, metric_store_daily, metric_promotion_daily, metric_inventory_daily

### Dashboards (5)
- rpt_executive_dashboard, rpt_sales_dashboard, rpt_customer_dashboard
- rpt_product_dashboard, rpt_store_dashboard

## Key Graph Patterns

- **Diamond**: stg_products -> int_products_with_categories + int_product_margins -> int_order_items_enriched
- **Deep fan-in**: customer_360 (4 inputs), rpt_executive_dashboard (3 inputs), int_order_enriched (3 inputs)
- **5 graph levels**: seed -> staging -> intermediate -> mart -> reporting
- **Cross-domain joins**: orders touch products, stores, promotions, payments
- **Incrementals**: int_daily_order_summary, int_product_stock_levels

## Node Count

| Layer | Count |
|-------|-------|
| Seeds | 12 |
| Staging | 12 |
| Intermediate | 25 |
| Mart | 35 |
| Reporting | 15 |
| **Total** | **99** |
Loading
Loading