Adding assertions

This commit is contained in:
Anna Saiapina 2024-03-20 13:37:41 +00:00 committed by GCP Dataform
parent 968bbf7dc4
commit 67a5edba12
7 changed files with 16 additions and 18 deletions

View File

@ -1,10 +1,6 @@
config {
type: "table",
schema: "pphe_five9_gold",
assertions: {
uniqueKey: ["?"],
nonNull: ["?"]
},
tags: ["daily"],
description: "All interactions table for CALLS and DIGITAL"
}

View File

@ -2,7 +2,7 @@ config {
type: "table",
schema: "pphe_five9_gold",
assertions: {
uniqueKey: ["CALL_ID"],
uniqueKey: ["CALL_ID", "TIMESTAMP_MILLISECOND"],
nonNull: ["CALL_ID"]
},
tags: ["daily"],

View File

@ -2,7 +2,7 @@ config {
type: "table",
schema: "pphe_five9_gold",
assertions: {
uniqueKey: ["CUSTOMER_ID"],
uniqueKey: ["CUSTOMER_ID", "TIMESTAMP_MILLISECOND"],
nonNull: ["CUSTOMER_ID"]
},
tags: ["daily"],

View File

@ -2,8 +2,10 @@ config {
type: "table",
schema: "pphe_five9_stg",
assertions: {
uniqueKey: ["CALL_ID"],
nonNull: ["CALL_ID"]
uniqueKey: ["CALL_ID", "TIMESTAMP_MILLISECOND"],
nonNull: ["CALL_ID", "AGENT_GROUP_ID", "DISPOSITION_ID",, "DISPOSITION_GROUP_ID",
"DISPOSITION_GROUP", "CAMPAIGN_ID", "CAMPAIGN_GROUP_ID",
"CAMPAIGN_GROUP", "SKILL_ID"]
},
tags: ["daily"],
description: "CALLS data with mappings"
@ -42,9 +44,7 @@ select cl.TIMESTAMP,
cl.ANI,
c.CAMPAIGN_TYPE_ID,
cl.CAMPAIGN_TYPE,
cl.DISPOSITION_GROUP_A,
cl.DISPOSITION_GROUP_B,
cl.DISPOSITION_GROUP_C,
cl.TIMESTAMP_MILLISECOND
from ${ref("stg_CALL_SOURCE")} cl
left join ${ref("stg_AGENT")} a
on cl.AGENT_ID = a.AGENT_ID

View File

@ -2,8 +2,8 @@ config {
type: "table",
schema: "pphe_five9_stg",
assertions: {
uniqueKey: ["ID"],
nonNull: ["ID"]
uniqueKey: ["CALL_ID", "TIMESTAMP_MILLISECOND"],
nonNull: ["CALL_ID"]
},
tags: ["daily"],
description: "Daily load of CALL_SOURCE table from raw"

View File

@ -2,8 +2,9 @@ config {
type: "table",
schema: "pphe_five9_stg",
assertions: {
uniqueKey: ["CUSTOMER_ID"],
nonNull: ["CUSTOMER_ID"]
uniqueKey: ["CUSTOMER_ID", "TIMESTAMP_MILLISECOND"],
nonNull: ["CUSTOMER_ID", "AGENT_GROUP_ID", "DISPOSITION_ID", "MEDIA_TYPE_ID",
"CAMPAIGN_ID", "CAMPAIGN_GROUP_ID", "CAMPAIGN_GROUP", "SKILL_ID"]
},
tags: ["daily"],
description: "DIGITAL data with mappings"
@ -33,7 +34,8 @@ select dl.TIMESTAMP,
dl.HANDLE_TIME,
dl.TRANSFERS_TO_SKILL,
dl.INTERACTIONS,
dl.CUSTOMER_ID
dl.CUSTOMER_ID,
dl.TIMESTAMP_MILLISECOND
from ${ref("stg_DIGITAL_SOURCE")} dl
left join ${ref("stg_AGENT")} a
on dl.AGENT_ID = a.AGENT_ID

View File

@ -2,8 +2,8 @@ config {
type: "table",
schema: "pphe_five9_stg",
assertions: {
uniqueKey: ["ID"],
nonNull: ["ID"]
uniqueKey: ["CUSTOMER_ID", "TIMESTAMP_MILLISECOND"],
nonNull: ["CUSTOMER_ID"]
},
tags: ["daily"],
description: "Daily load of DIGITAL_SOURCE table from raw"