From 0ba3f13055680a4c7fa4d7f5e84f142736858ee9 Mon Sep 17 00:00:00 2001 From: Pablo Martin Date: Mon, 12 Aug 2024 10:37:40 +0200 Subject: [PATCH 1/3] add claim to sources --- models/staging/core/_core_sources.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/models/staging/core/_core_sources.yml b/models/staging/core/_core_sources.yml index f9bdb59..7399ec1 100644 --- a/models/staging/core/_core_sources.yml +++ b/models/staging/core/_core_sources.yml @@ -219,3 +219,5 @@ sources: identifier: UserRole - name: Role identifier: Role + - name: Claim + identifier: Claim From 81b900b6d2ce02f5cd1d727ca49052ca3e9debef Mon Sep 17 00:00:00 2001 From: Pablo Martin Date: Mon, 12 Aug 2024 10:42:29 +0200 Subject: [PATCH 2/3] add claim to staging --- models/staging/core/stg_core__claim.sql | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 models/staging/core/stg_core__claim.sql diff --git a/models/staging/core/stg_core__claim.sql b/models/staging/core/stg_core__claim.sql new file mode 100644 index 0000000..f76665f --- /dev/null +++ b/models/staging/core/stg_core__claim.sql @@ -0,0 +1,14 @@ +with + raw_claim as (select * from {{ source("core", "Claim") }}), + stg_core__claim as ( + select + {{ adapter.quote("Id") }} as id_claim, + {{ adapter.quote("UserId") }} as id_user, + {{ adapter.quote("ClaimType") }} as claim_type, + {{ adapter.quote("ClaimValue") }} as claim_value, + {{ adapter.quote("_airbyte_extracted_at") }} as dwh_extracted_at_utc + + from raw_claim + ) +select * +from stg_core__claim From cfe02fb99c6767fefd6546d74a4ad873da547118 Mon Sep 17 00:00:00 2001 From: Pablo Martin Date: Mon, 12 Aug 2024 10:42:40 +0200 Subject: [PATCH 3/3] add PK test --- models/staging/core/schema.yml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/models/staging/core/schema.yml b/models/staging/core/schema.yml index c1d48f3..9cd94ef 100644 --- a/models/staging/core/schema.yml +++ b/models/staging/core/schema.yml @@ -153,4 +153,10 @@ models: - not_null - name: id_user tests: - - not_null \ No newline at end of file + - not_null + - name: stg_core__claim + columns: + - name: id_claim + tests: + - unique + - not_null