From 3620401037d23ec3d59556a62bff29eb5fad2784 Mon Sep 17 00:00:00 2001 From: Pablo Martin Date: Thu, 7 Mar 2024 16:29:50 +0100 Subject: [PATCH] work --- models/staging/core/_core_sources.yml | 37 ++++++++++++++++++-------- models/staging/core/stg_core__user.sql | 2 +- 2 files changed, 27 insertions(+), 12 deletions(-) diff --git a/models/staging/core/_core_sources.yml b/models/staging/core/_core_sources.yml index 3e5d97c..e4315ce 100644 --- a/models/staging/core/_core_sources.yml +++ b/models/staging/core/_core_sources.yml @@ -14,23 +14,38 @@ sources: tests: - unique - not_null - # - dbt_expectations.expect_column_values_to_match_regex: - # regex: "^[0-9A-Fa-f]{8}-[0-9A-Fa-f]{4}-4[0-9A-Fa-f]{3}-[89ABab][0-9A-Fa-f]{3}-[0-9A-Fa-f]{12}$" - - name: code + - dbt_expectations.expect_column_values_to_match_regex: + regex: "^[0-9A-Fa-f]{8}-[0-9A-Fa-f]{4}-4[0-9A-Fa-f]{3}-[89ABab][0-9A-Fa-f]{3}-[0-9A-Fa-f]{12}$" + - name: Code data_type: bigint - description: "" - - name: email + quote: True + description: "WIP. Is this an increment unique ID?" + tests: + - unique + - not_null + - name: Email data_type: character varying - description: "" - - name: title + quote: True + description: "Email for this user." + tests: + - unique + - not_null + - name: Title data_type: character varying + quote: True description: "" - - name: dealid + - name: DealId data_type: character varying - description: "" - - name: deleted + quote: True + description: "The Hubspot Deal Id that this user account belongs to. Multiple users can all be part of one Deal." + # This test can't be enforced yet due to some bad test data in the production database. Once that's deal with, this should be activated. + #tests: + # - dbt_expectations.expect_column_values_to_match_regex: + # regex: "^[0-9]{10,11}$" + - name: Deleted data_type: boolean - description: "" + quote: True + description: "WIP. I'm guessing this signals that the user wanted to be deleted?" - name: joindate data_type: timestamp without time zone description: "" diff --git a/models/staging/core/stg_core__user.sql b/models/staging/core/stg_core__user.sql index 8c50ef7..ac4ec0e 100644 --- a/models/staging/core/stg_core__user.sql +++ b/models/staging/core/stg_core__user.sql @@ -1,5 +1,5 @@ with - raw_user as (select * from {{ source("core", "user") }}), + raw_user as (select * from {{ source("core", "User") }}), stg_core__user as ( select {{ adapter.quote("Id") }} as id_user,