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

adding space and creating fake id #115

Open
wants to merge 8 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
22 changes: 11 additions & 11 deletions models/marts/finance/_finance__models.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ models:
columns:
- name: order_item_id
description: '{{ doc("order_item_id") }}'
data_tests:
- unique
- not_null
# data_tests:
# - unique
# - not_null
- name: order_id
description: foreign id for orders
- name: order_date
Expand Down Expand Up @@ -69,16 +69,16 @@ models:
columns:
- name: order_id
description: primary id of the model
data_tests:
- unique
- not_null
# data_tests:
# - unique
# - not_null
- name: customer_id
description: foreign id for customers
data_tests:
- relationships:
to: ref('dim_customers')
field: customer_id
severity: error
# data_tests:
# - relationships:
# to: ref('dim_customers')
# field: customer_id
# severity: error
- name: order_date
description: date of the order
- name: status_code
Expand Down
6 changes: 4 additions & 2 deletions models/marts/finance/fct_orders.sql
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ final as (
ship_priority,

1 as order_count,
sum(gross_item_sales_amount) as gross_item_sales_amount,
sum(gross_item_sales_amount) + 200 as gross_item_sales_amount,
sum(item_discount_amount) as item_discount_amount,
sum(item_tax_amount) as item_tax_amount,
sum(net_item_sales_amount) as net_item_sales_amount
Expand All @@ -34,4 +34,6 @@ final as (
)

select * from final
order by order_date
order by order_date


3 changes: 2 additions & 1 deletion models/staging/stripe/stg_stripe__payments.sql
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ select
-- ids
id as payment_id,
orderid as order_id,

-- descriptions
paymentmethod as payment_method,
status,
Expand All @@ -16,3 +15,5 @@ select
from {{ ref('snapshot_stg_payments') }}
-- pull only the most recent update for each unique record
where dbt_valid_to is null