Skip to content

Commit

Permalink
Rename clean_columns
Browse files Browse the repository at this point in the history
  • Loading branch information
SorenSpicknall committed Oct 11, 2023
1 parent a5249f6 commit 24e088e
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ WITH source AS (
SELECT * FROM {{ source('external_littlepay', 'customer_funding_source') }}
),

clean_columns_and_dedupe_files AS (
clean_columns AS (
SELECT
{{ trim_make_empty_string_null('funding_source_id') }} AS funding_source_id,
{{ trim_make_empty_string_null('funding_source_vault_id') }} AS funding_source_vault_id,
Expand Down Expand Up @@ -44,7 +44,7 @@ add_keys_drop_full_dupes AS (
-- generate keys now that input columns have been trimmed & cast and files deduped
{{ dbt_utils.generate_surrogate_key(['littlepay_export_ts', '_line_number', 'instance']) }} AS _key,
{{ dbt_utils.generate_surrogate_key(['funding_source_id', 'customer_id']) }} AS _payments_key,
FROM clean_columns_and_dedupe_files
FROM clean_columns
{{ qualify_dedupe_full_duplicate_lp_rows() }}
),

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ WITH source AS (
SELECT * FROM {{ source('external_littlepay', 'device_transaction_purchases') }}
),

clean_columns_and_dedupe_files AS (
clean_columns AS (
SELECT
{{ trim_make_empty_string_null('littlepay_transaction_id') }} AS littlepay_transaction_id,
{{ trim_make_empty_string_null('purchase_id') }} AS purchase_id,
Expand Down Expand Up @@ -31,7 +31,7 @@ add_keys_drop_full_dupes AS (
-- generate keys now that input columns have been trimmed & cast and files deduped
{{ dbt_utils.generate_surrogate_key(['littlepay_export_ts', '_line_number', 'instance']) }} AS _key,
{{ dbt_utils.generate_surrogate_key(['littlepay_transaction_id', 'purchase_id']) }} AS _payments_key,
FROM clean_columns_and_dedupe_files
FROM clean_columns
{{ qualify_dedupe_full_duplicate_lp_rows() }}
),

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ WITH source AS (
SELECT * FROM {{ source('external_littlepay', 'device_transactions') }}
),

clean_columns_and_dedupe_files AS (
clean_columns AS (
SELECT
{{ trim_make_empty_string_null('participant_id') }} AS participant_id,
{{ trim_make_empty_string_null('customer_id') }} AS customer_id,
Expand Down Expand Up @@ -55,7 +55,7 @@ add_keys_drop_full_dupes AS (
-- generate keys now that input columns have been trimmed & cast and files deduped
{{ dbt_utils.generate_surrogate_key(['littlepay_export_ts', '_line_number', 'instance']) }} AS _key,
littlepay_transaction_id AS _payments_key,
FROM clean_columns_and_dedupe_files
FROM clean_columns
{{ qualify_dedupe_full_duplicate_lp_rows() }}
),

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ WITH source AS (
SELECT * FROM {{ source('external_littlepay', 'micropayment_adjustments') }}
),

clean_columns_and_dedupe_files AS (
clean_columns AS (
SELECT
{{ trim_make_empty_string_null('micropayment_id') }} AS micropayment_id,
{{ trim_make_empty_string_null('adjustment_id') }} AS adjustment_id,
Expand Down Expand Up @@ -35,7 +35,7 @@ add_keys_drop_full_dupes AS (
-- generate keys now that input columns have been trimmed & cast and files deduped
{{ dbt_utils.generate_surrogate_key(['littlepay_export_ts', '_line_number', 'instance']) }} AS _key,
{{ dbt_utils.generate_surrogate_key(['micropayment_id', 'adjustment_id']) }} AS _payments_key,
FROM clean_columns_and_dedupe_files
FROM clean_columns
{{ qualify_dedupe_full_duplicate_lp_rows() }}
),

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ WITH source AS (
SELECT * FROM {{ source('external_littlepay', 'micropayment_device_transactions') }}
),

clean_columns_and_dedupe_files AS (
clean_columns AS (
SELECT
{{ trim_make_empty_string_null('littlepay_transaction_id') }} AS littlepay_transaction_id,
{{ trim_make_empty_string_null('micropayment_id') }} AS micropayment_id,
Expand All @@ -24,7 +24,7 @@ add_keys_drop_full_dupes AS (
-- generate keys now that input columns have been trimmed & cast and files deduped
{{ dbt_utils.generate_surrogate_key(['littlepay_export_ts', '_line_number', 'instance']) }} AS _key,
{{ dbt_utils.generate_surrogate_key(['littlepay_transaction_id', 'micropayment_id']) }} AS _payments_key,
FROM clean_columns_and_dedupe_files
FROM clean_columns
{{ qualify_dedupe_full_duplicate_lp_rows() }}
),

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ WITH source AS (
SELECT * FROM {{ source('external_littlepay', 'product_data') }}
),

clean_columns_and_dedupe_files AS (
clean_columns AS (
SELECT
{{ trim_make_empty_string_null('participant_id') }} AS participant_id,
{{ trim_make_empty_string_null('product_id') }} AS product_id,
Expand Down Expand Up @@ -54,7 +54,7 @@ add_keys_drop_full_dupes AS (
-- generate keys now that input columns have been trimmed & cast and files deduped
{{ dbt_utils.generate_surrogate_key(['littlepay_export_ts', '_line_number', 'instance']) }} AS _key,
product_id AS _payments_key,
FROM clean_columns_and_dedupe_files
FROM clean_columns
{{ qualify_dedupe_full_duplicate_lp_rows() }}
),

Expand Down

0 comments on commit 24e088e

Please sign in to comment.