Merged PR 3875: Propagates AccountType to staging
# Description Propagates `AccountType` to staging by creating the first version of the model `stg_core__account_type` # Checklist - [X] The edited models and dependants run properly with production data. - [X] The edited models are sufficiently documented. - [X] The edited models contain PK tests, and I've ran and passed them. - [X] I have checked for DRY opportunities with other models and docs. - [X] I've picked the right materialization for the affected models. # Other - [ ] Check if a full-refresh is required after this PR is merged. Related work items: #18944
This commit is contained in:
parent
14fd52bb36
commit
7b28bbb925
3 changed files with 55 additions and 0 deletions
|
|
@ -275,3 +275,5 @@ sources:
|
|||
identifier: ScreenAndProtect
|
||||
- name: StandaloneProtection
|
||||
identifier: StandaloneProtection
|
||||
- name: AccountType
|
||||
identifier: AccountType
|
||||
|
|
|
|||
|
|
@ -1803,3 +1803,43 @@ models:
|
|||
description: "Timestamp of when this record was extracted into DWH."
|
||||
tests:
|
||||
- not_null
|
||||
|
||||
- name: stg_core__account_type
|
||||
description: |
|
||||
A table containing the different types of accounts created in SH backend.
|
||||
|
||||
columns:
|
||||
- name: id_account_type
|
||||
data_type: bigint
|
||||
description: |
|
||||
Unique identifier of the account type.
|
||||
Acts as the primary key for this table.
|
||||
tests:
|
||||
- not_null
|
||||
- unique
|
||||
|
||||
- name: account_type_name
|
||||
data_type: character varying
|
||||
description: |
|
||||
Name of the account, in upper case, without spacing.
|
||||
Cannot be null. Must be unique.
|
||||
tests:
|
||||
- not_null
|
||||
- unique
|
||||
|
||||
- name: account_type_display_name
|
||||
data_type: character varying
|
||||
description: |
|
||||
A more nicer way to display the name of the account, better fit
|
||||
for reporting purposes.
|
||||
Cannot be null. Must be unique.
|
||||
tests:
|
||||
- not_null
|
||||
- unique
|
||||
|
||||
- name: dwh_extracted_at_utc
|
||||
data_type: timestamp with time zone
|
||||
description: |
|
||||
Timestamp of when this record was extracted into DWH.
|
||||
tests:
|
||||
- not_null
|
||||
|
|
|
|||
13
models/staging/core/stg_core__account_type.sql
Normal file
13
models/staging/core/stg_core__account_type.sql
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
with
|
||||
raw_account_type as (select * from {{ source("core", "AccountType") }}),
|
||||
stg_core__account_type as (
|
||||
select
|
||||
{{ adapter.quote("Id") }} as id_account_type,
|
||||
upper({{ adapter.quote("Name") }}) as account_type_name,
|
||||
{{ adapter.quote("FullName") }} as account_type_display_name,
|
||||
{{ adapter.quote("_airbyte_extracted_at") }} as dwh_extracted_at_utc
|
||||
|
||||
from raw_account_type
|
||||
)
|
||||
select *
|
||||
from stg_core__account_type
|
||||
Loading…
Add table
Add a link
Reference in a new issue