-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
56 changed files
with
1,339 additions
and
2,869 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1,29 @@ | ||
name: 'stripe_analytics' | ||
|
||
config-version: 2 | ||
version: '0.1' | ||
|
||
profile: 'stripe_analytics' | ||
|
||
model-paths: ["models"] | ||
test-paths: ["tests"] | ||
analysis-paths: ["analysis"] | ||
macro-paths: ["macros"] | ||
|
||
target-path: "target" | ||
clean-targets: | ||
- "target" | ||
- "dbt_modules" | ||
- "logs" | ||
|
||
require-dbt-version: [">=1.0.0", "<2.0.0"] | ||
|
||
models: | ||
stripe_analytics: | ||
materialized: table | ||
staging: | ||
materialized: view | ||
+docs: | ||
node_color: 'silver' | ||
+docs: | ||
name: 'stripe_analytics' | ||
|
||
config-version: 2 | ||
version: '0.1' | ||
|
||
profile: 'stripe_analytics' | ||
|
||
model-paths: ["models"] | ||
test-paths: ["tests"] | ||
analysis-paths: ["analysis"] | ||
macro-paths: ["macros"] | ||
|
||
target-path: "target" | ||
clean-targets: | ||
- "target" | ||
- "dbt_modules" | ||
- "logs" | ||
|
||
require-dbt-version: [">=1.0.0", "<2.0.0"] | ||
|
||
models: | ||
stripe_analytics: | ||
materialized: table | ||
staging: | ||
materialized: view | ||
+docs: | ||
node_color: 'silver' | ||
+docs: | ||
node_color: 'gold' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,13 @@ | ||
/* check if the destination already has a list of processed ids | ||
if not we will process all loads with status 0 (==success) */ | ||
{% set active_ids_exist = adapter.get_relation( | ||
database=this.database , | ||
schema=this.schema, | ||
identifier="dlt_processed_load_ids" ) %} | ||
|
||
SELECT load_id FROM {{ source('raw_data', '_dlt_loads') }} | ||
WHERE status = 0 | ||
/* exclude already processed load_ids */ | ||
{% if active_ids_exist and not should_full_refresh() %} | ||
AND load_id NOT IN (SELECT load_id FROM {{ source('transformed_data', 'dlt_processed_load_ids') }}) | ||
/* check if the destination already has a list of processed ids | ||
if not we will process all loads with status 0 (==success) */ | ||
{% set active_ids_exist = adapter.get_relation( | ||
database=this.database , | ||
schema=this.schema, | ||
identifier="dlt_processed_load_ids" ) %} | ||
|
||
SELECT load_id FROM {{ source('raw_data', '_dlt_loads') }} | ||
WHERE status = 0 | ||
/* exclude already processed load_ids */ | ||
{% if active_ids_exist and not should_full_refresh() %} | ||
AND load_id NOT IN (SELECT load_id FROM {{ source('transformed_data', 'dlt_processed_load_ids') }}) | ||
{% endif %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,31 +1,35 @@ | ||
{{ | ||
config( | ||
materialized='incremental' | ||
) | ||
}} | ||
-- depends_on: {{ ref('dim__dlt_loads') }} | ||
-- depends_on: {{ ref('fact_subscription') }} | ||
-- depends_on: {{ ref('dim_coupon') }} | ||
-- depends_on: {{ ref('dim_customer') }} | ||
-- depends_on: {{ ref('dim_product') }} | ||
-- depends_on: {{ ref('dim_price') }} | ||
-- depends_on: {{ ref('fact_event') }} | ||
-- depends_on: {{ ref('fact_invoice') }} | ||
-- depends_on: {{ ref('fact_balance_transaction') }} | ||
-- depends_on: {{ ref('dim_balance_transaction__fee_details') }} | ||
-- depends_on: {{ ref('dim_event__data__object__discounts') }} | ||
-- depends_on: {{ ref('dim_event__data__object__lines__data') }} | ||
-- depends_on: {{ ref('dim_event__data__object__lines__data__discount_amounts') }} | ||
-- depends_on: {{ ref('dim_event__data__object__total_discount_amounts') }} | ||
-- depends_on: {{ ref('dim_event__data__object__available') }} | ||
-- depends_on: {{ ref('dim_event__data__object__pending') }} | ||
-- depends_on: {{ ref('dim_event__data__object__payment_method_types') }} | ||
-- depends_on: {{ ref('dim_event__data__object__items__data') }} | ||
-- depends_on: {{ ref('dim_invoice__discounts') }} | ||
-- depends_on: {{ ref('dim_invoice__lines__data') }} | ||
-- depends_on: {{ ref('dim_invoice__lines__data__discount_amounts') }} | ||
-- depends_on: {{ ref('dim_invoice__total_discount_amounts') }} | ||
-- depends_on: {{ ref('dim_subscription__discounts') }} | ||
-- depends_on: {{ ref('dim_subscription__items__data') }} | ||
/* we save all currently active load ids into the processed ids table */ | ||
{{ | ||
config( | ||
materialized='incremental' | ||
) | ||
}} | ||
-- depends_on: {{ ref('dim__dlt_loads') }} | ||
-- depends_on: {{ ref('dim_subscription') }} | ||
-- depends_on: {{ ref('dim_coupon') }} | ||
-- depends_on: {{ ref('dim_customer') }} | ||
-- depends_on: {{ ref('dim_product') }} | ||
-- depends_on: {{ ref('dim_price') }} | ||
-- depends_on: {{ ref('dim_event') }} | ||
-- depends_on: {{ ref('dim_invoice') }} | ||
-- depends_on: {{ ref('dim_balance_transaction') }} | ||
-- depends_on: {{ ref('dim_balance_transaction__fee_details') }} | ||
-- depends_on: {{ ref('dim_event__data__object__available') }} | ||
-- depends_on: {{ ref('dim_event__data__object__pending') }} | ||
-- depends_on: {{ ref('dim_event__data__object__discounts') }} | ||
-- depends_on: {{ ref('dim_event__data__object__lines__data') }} | ||
-- depends_on: {{ ref('dim_event__data__object__lines__data__discount_amounts') }} | ||
-- depends_on: {{ ref('dim_event__data__object__lines__data__pretax_credit_amounts') }} | ||
-- depends_on: {{ ref('dim_event__data__object__total_discount_amounts') }} | ||
-- depends_on: {{ ref('dim_event__data__object__total_pretax_credit_amounts') }} | ||
-- depends_on: {{ ref('dim_event__data__object__payment_method_types') }} | ||
-- depends_on: {{ ref('dim_event__data__object__items__data') }} | ||
-- depends_on: {{ ref('dim_invoice__discounts') }} | ||
-- depends_on: {{ ref('dim_invoice__lines__data') }} | ||
-- depends_on: {{ ref('dim_invoice__lines__data__discount_amounts') }} | ||
-- depends_on: {{ ref('dim_invoice__lines__data__pretax_credit_amounts') }} | ||
-- depends_on: {{ ref('dim_invoice__total_discount_amounts') }} | ||
-- depends_on: {{ ref('dim_invoice__total_pretax_credit_amounts') }} | ||
-- depends_on: {{ ref('dim_subscription__discounts') }} | ||
-- depends_on: {{ ref('dim_subscription__items__data') }} | ||
/* we save all currently active load ids into the processed ids table */ | ||
select load_id, {{ current_timestamp() }} as inserted_at FROM {{ ref('dlt_active_load_ids') }} |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.