Merged PR 3879: Feedback on current process
# Description Rename changes and adding some necessary fields like `id_currency` to some S&P models # 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. Feedback on current process Related work items: #25360
This commit is contained in:
commit
3b17fa231e
8 changed files with 56 additions and 26 deletions
|
|
@ -2,12 +2,12 @@
|
|||
|
||||
with
|
||||
stg_core__apim_user as (select * from {{ ref("stg_core__apim_user") }}),
|
||||
stg_core__apim_user_type as (select * from {{ ref("stg_core__apim_user_type") }})
|
||||
stg_core__apim_user_type as (select * from {{ ref("stg_core__apim_user_type") }}),
|
||||
stg_core__user as (select * from {{ ref("stg_core__user") }})
|
||||
select
|
||||
-- note that these ids are not the same as the ones found in Core
|
||||
-- they are completely unrelated
|
||||
au.id_apim_user,
|
||||
au.id_apim_user_type,
|
||||
u.id_account_currency as id_currency,
|
||||
au.json_document_user_data ->> 'DealId' as id_deal,
|
||||
au.json_document_user_data ->> 'AccountType' as account_type,
|
||||
au.json_document_user_data ->> 'ClientMarkup' as client_markup,
|
||||
|
|
@ -44,3 +44,4 @@ inner join
|
|||
stg_core__apim_user_type aut
|
||||
on au.id_apim_user_type = aut.id_apim_user_type
|
||||
and upper(aut.user_type_name) = '{{ api_name }}'
|
||||
inner join stg_core__user u on au.id_apim_user = u.id_user
|
||||
|
|
|
|||
|
|
@ -4590,6 +4590,16 @@ models:
|
|||
data_type: bigint
|
||||
description: "Identifier of the type of user."
|
||||
|
||||
- name: id_currency
|
||||
data_type: bigint
|
||||
description: "Id of the currency, works as a foreign key to the
|
||||
currency table"
|
||||
tests:
|
||||
- not_null
|
||||
- relationships:
|
||||
to: ref('stg_core__currency')
|
||||
field: id_currency
|
||||
|
||||
- name: id_deal
|
||||
data_type: text
|
||||
description: ""
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue