Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update dbt project #5

Open
wants to merge 29 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
b4265b5
Merge pull request #4 from lightdash/main
May 19, 2021
c112cea
changes to sql code to make it work on ssms
Jul 7, 2021
ac846cb
not relevant for non dbt-sqlserver users
chaerinlee1 Jul 8, 2021
f5f945d
Add whitespace for MYSQL compatibility.
davinchia Jul 9, 2021
8b69516
not all dbs support 'using'
dataders Sep 7, 2021
5cfe454
Update models/customers.sql
chaerinlee1 Sep 9, 2021
66f2a84
Update models/customers.sql
chaerinlee1 Sep 9, 2021
085cc3d
Update models/customers.sql
chaerinlee1 Sep 9, 2021
06c391a
Update models/customers.sql
chaerinlee1 Sep 9, 2021
b1c4239
Update models/customers.sql
chaerinlee1 Sep 9, 2021
650a920
Update models/customers.sql
chaerinlee1 Sep 9, 2021
c702546
Update models/orders.sql
chaerinlee1 Sep 9, 2021
6c3fb34
Update models/customers.sql
chaerinlee1 Sep 9, 2021
9fba558
Update models/customers.sql
chaerinlee1 Sep 9, 2021
4256f09
Update models/orders.sql
chaerinlee1 Sep 9, 2021
ce984bb
Update models/orders.sql
chaerinlee1 Sep 9, 2021
90f7756
Update models/orders.sql
chaerinlee1 Sep 9, 2021
6ef3833
Update models/orders.sql
chaerinlee1 Sep 9, 2021
542f072
Merge pull request #8 from davinchia/patch-1
annafil Sep 9, 2021
b08b27e
Merge pull request #6 from chaerinlee1/dbt_crash_course
annafil Sep 9, 2021
8ebbc1e
Merge branch 'main' into more_generic
annafil Sep 9, 2021
2551fd0
Merge pull request #11 from swanderz/more_generic
annafil Sep 9, 2021
3fbdf16
Update link to dbt-learn-demo in README.md
alexiswo Oct 14, 2021
ec9e481
Merge pull request #14 from dbt-labs/alexiswo-patch-1
alexiswo Oct 19, 2021
ec36ae1
Update deprecated path names to current ones.
VersusFacit Feb 8, 2022
b1680f3
Added require dbt version and reordered profile to be compliant with …
VersusFacit Feb 8, 2022
b0b77aa
Merge pull request #20 from dbt-labs/update_deprecate_config_field
joellabes Feb 8, 2022
81ddf7b
Update README with disclaimer that no longer maintained
gwenwindflower Apr 18, 2024
fd7bfac
Update README to fix typo in disclaimer
gwenwindflower Apr 18, 2024
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
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
> [!IMPORTANT]
> This repo is no longer actively maintained. It’s been preserved for continuity and free access. The Jaffle Shop has lived a rich life as dbt’s demo project, but has been superseded by two newer repositories: [`jaffle-shop`](https://github.com/dbt-labs/jaffle-shop), the premier demo project for dbt Cloud, and [`jaffle_shop_duckdb`](https://github.com/dbt-labs/jaffle_shop_duckdb) which supports working locally via DuckDB for those without access to a cloud warehouse. You’re welcome to continue using this repo as an open source resource, just know it will not be actively maintained moving forward.

## Testing dbt project: `jaffle_shop`

`jaffle_shop` is a fictional ecommerce store. This dbt project transforms raw data from an app database into a customers and orders model ready for analytics.
Expand All @@ -8,7 +11,7 @@ What this repo _is_:

What this repo _is not_:
- A tutorial — check out the [Getting Started Tutorial](https://docs.getdbt.com/tutorial/setting-up) for that. Notably, this repo contains some anti-patterns to make it self-contained, namely the use of seeds instead of sources.
- A demonstration of best practices — check out the [dbt Learn Demo](https://github.com/fishtown-analytics/dbt-learn-demo-v2-archive) repo instead. We want to keep this project as simple as possible. As such, we chose not to implement:
- A demonstration of best practices — check out the [dbt Learn Demo](https://github.com/dbt-labs/dbt-learn-demo) repo instead. We want to keep this project as simple as possible. As such, we chose not to implement:
- our standard file naming patterns (which make more sense on larger projects, rather than this five-model project)
- a pull request flow
- CI/CD integrations
Expand Down
13 changes: 8 additions & 5 deletions dbt_project.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@

name: 'jaffle_shop'

config-version: 2
version: '0.1'

profile: 'jaffle_shop'
config-version: 2

source-paths: ["models"]
analysis-paths: ["analysis"]
model-paths: ["models"]
seed-paths: ["seeds"]
test-paths: ["tests"]
data-paths: ["data"]
analysis-paths: ["analysis"]
macro-paths: ["macros"]

target-path: "target"
Expand All @@ -16,6 +17,8 @@ clean-targets:
- "dbt_modules"
- "logs"

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

models:
jaffle_shop:
materialized: table
Expand Down
13 changes: 8 additions & 5 deletions models/customers.sql
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ customer_orders as (
count(order_id) as number_of_orders
from orders

group by 1
group by customer_id

),

Expand All @@ -38,9 +38,10 @@ customer_payments as (

from payments

left join orders using (order_id)
left join orders on
payments.order_id = orders.order_id

group by 1
group by orders.customer_id

),

Expand All @@ -57,9 +58,11 @@ final as (

from customers

left join customer_orders using (customer_id)
left join customer_orders
on customers.customer_id = customer_orders.customer_id

left join customer_payments using (customer_id)
left join customer_payments
on customers.customer_id = customer_payments.customer_id

)

Expand Down
6 changes: 4 additions & 2 deletions models/orders.sql
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ order_payments as (

from payments

group by 1
group by order_id

),

Expand All @@ -47,7 +47,9 @@ final as (

from orders

left join order_payments using (order_id)

left join order_payments
on orders.order_id = order_payments.order_id

)

Expand Down
2 changes: 1 addition & 1 deletion models/staging/stg_payments.sql
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ renamed as (
order_id,
payment_method,

--`amount` is currently stored in cents, so we convert it to dollars
-- `amount` is currently stored in cents, so we convert it to dollars
amount / 100 as amount

from source
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.