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

Anything with commit changes #107

Open
wants to merge 30 commits into
base: qa
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
b8aac1e
Anything with commit changes
Sep 16, 2024
673b5d1
refactoring snapshot_stg_payments and snapshot_stg_payments to match …
Nov 8, 2024
910cccc
deleting generate schema snapshot--i don't think this is relevant any…
Nov 8, 2024
c11e92d
deleting old orders_line_items snapshot, replacing it with new config…
Nov 8, 2024
080bb94
refactoring example_orders_snapshot into new way
Nov 8, 2024
2c8532a
convert example join snapshot to markdown till better fix avail
Nov 8, 2024
ef2f547
fixing order snapshot
Nov 8, 2024
833d85c
fixing snapshot line items
Nov 8, 2024
281c438
Merge pull request #116 from dbt-labs/feat/snapshots_refactor
faithebear Nov 8, 2024
0fa6002
Merge branch 'main' of https://github.com/dbt-labs/rapid-onboarding-e…
Nov 18, 2024
ba8118a
Commit changes
Nov 18, 2024
6f267b4
Commit changes for tests
Nov 26, 2024
9d6fef6
Added singular test
Nov 26, 2024
08a594f
Commit changes. Added contracts.
Nov 26, 2024
62a15a7
Commit changes; unit test
Nov 27, 2024
5485517
Commit changes for unit test
Nov 28, 2024
2cbb34b
commit changes for unit test
Nov 28, 2024
2624cb3
commit updates
Dec 3, 2024
3b4efda
Update changes
Dec 3, 2024
d84881a
commit changes
Dec 4, 2024
f803d7d
Commit changes
Dec 4, 2024
b76018b
Update changes
Dec 4, 2024
baa0d3f
Update tags
Dec 4, 2024
419f358
commit changes
Dec 5, 2024
961a243
Commit changes
Dec 5, 2024
9bf0cc0
commit changes
Dec 5, 2024
3f36a3a
Commit changes
Dec 5, 2024
60cf779
Commit changes
Dec 5, 2024
03dc3d3
Commit changes
Dec 5, 2024
893fcb9
commit updates
Dec 5, 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
Empty file added analysis/test_file.sql
Empty file.
20 changes: 14 additions & 6 deletions dbt_project.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ vars:
incremental_lookback_period: 'hour'
future_proof_date: '9999-12-31'

on-run-end:
- "{% if target.name == 'prod' %}{{ dbt_artifacts.upload_results(results) }}{% endif %}"
# on-run-end:
# - "{% if target.name == 'prod' %}{{ dbt_artifacts.upload_results(results) }}{% endif %}"


# Configuring models
Expand All @@ -42,12 +42,23 @@ models:
marts:
+materialized: table
+tags: ['tag']
dims:
+tags: ["myorders"]
facts:
+tags: ["myorders"]
finance:
+group: finance
marketing:
+group: marketing
operations:
+group: operations
accounting:
+group: accounting
+access: public
cfo:
+group: cfo
+access: public

intermediate:
+materialized: view
staging:
Expand All @@ -65,7 +76,4 @@ models:
+materialized: ephemeral

tests:
rapid_onboarding_exemplar:
_samples:
staging:
+store_failures: "{{ true if target.name == 'prod' else false }}"
+store_failures: false
5 changes: 5 additions & 0 deletions macros/test_macro.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{% macro test_macro() %}

{{ log("This is a message by log macro", info=True) }}

{% endmacro %}
11 changes: 11 additions & 0 deletions models/_groups.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
groups:
- name: cfo
owner:
# 'name' or 'email' is required; additional properties allowed
email: [email protected]

- name: accounting
owner:
email: [email protected]


1 change: 1 addition & 0 deletions models/_samples/incremental/example_incremental_model.sql
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

with source as (
select * from {{ ref('example_source_for_incremental') }}

{% if is_incremental() %}
-- this filter will only be applied on an incremental run
where _etl_loaded_at > (select max(_etl_loaded_at) from {{ this }})
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
with order_snapshot as (
{# with order_snapshot as (
select
* exclude dbt_valid_to,
coalesce(dbt_valid_to, cast('{{ var("future_proof_date") }}' as timestamp)) as dbt_valid_to
Expand Down Expand Up @@ -47,3 +47,4 @@ final as (
)

select * from final
#}
72 changes: 0 additions & 72 deletions models/_samples/staging/jaffle_shop/_jaffle_shop__models.yml

This file was deleted.

53 changes: 0 additions & 53 deletions models/_samples/staging/jaffle_shop/stg_jaffle_shop__customers.sql

This file was deleted.

48 changes: 0 additions & 48 deletions models/_samples/staging/jaffle_shop/stg_jaffle_shop__orders.sql

This file was deleted.

36 changes: 36 additions & 0 deletions models/intermediate/finance/int_daily_orders_fact.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
with

dates as (

select * from {{ ref('dim_dates') }}

),

orders as (

select * from {{ ref('dim_orders') }}

),

countries as (

select * from {{ ref('dim_countries') }}

),

join_sources as (

select
ordr.order_sk,
country.country_sk as order_country_origin_sk,
date.date_sk as order_date_sk,
ordr.order_quantity
from orders ordr
left join dates date
on ordr.order_date = date.calendar_date
left join countries country
on ordr.order_country_origin = country.country_name

)

select * from join_sources
67 changes: 67 additions & 0 deletions models/intermediate/orders/int_revenue_fct.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
{{ config(
materialized='table',
tags=["cfo"]
) }}

with

depreciations as (

select * from {{ ref('dim_depreciation_accounts') }}
where account_type = 'Major'

),

interests as (

select * from {{ ref('dim_interests_accounts') }}
where account_type = 'Major'

),

net_income as (

select * from {{ ref('dim_net_income') }}
where account_type = 'Major'

),


taxes as (

select * from {{ ref('dim_tax_accounts') }}
where account_type = 'Major'

),

join_sources as (

select
net_inc.account_id,
net_inc.net_income_usd,
deprec.depreciation_cost_usd,
ints.interests_amount_usd,
tax.tax_usd,
net_inc.account_type
from net_income net_inc
left join depreciations deprec
on net_inc.account_id = deprec.account_id
left join interests ints
on net_inc.account_id = ints.account_id
left join taxes tax
on net_inc.account_id = tax.account_id

),

final as (

select
account_id,
account_type,
(net_income_usd + interests_amount_usd + tax_usd + depreciation_cost_usd)::numeric(10, 3) as ebitda
from join_sources

)

select * from final

14 changes: 14 additions & 0 deletions models/marts/cfo/fct_revenue.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{{ config(
materialized='table',
tags=["cfo"]
) }}

with

sources as (

select * from {{ ref('int_revenue_fct') }}

)

select * from sources
Loading
Loading