diff --git a/chapter5/models/schema.yml b/chapter5/models/schema.yml index d149add..d229767 100644 --- a/chapter5/models/schema.yml +++ b/chapter5/models/schema.yml @@ -10,13 +10,26 @@ models: columns: - name: adid description: "The advertisting ID for this data point. Every value in column should be a distinct ad_id. This value is required." + tests: + - unique + - not_null - name: latitude description: "The latitude of the data point. This value is required." + tests: + - not_null - name: longitude description: "The longitude of the data point. This value is required." + tests: + - not_null - name: city description: "The city of the data point. This value is required." + tests: + - not_null - name: eventdate description: "The date of the data point. This value is required." + tests: + - not_null - name: cohort - description: "The cohort of the adid. Theree are only 6 cohorts, each named either 'one', 'two', 'three', 'four', 'five', or 'six'. This value is required. Each cohort should have a maximum of 110 distinct adids." \ No newline at end of file + description: "The cohort of the adid. Theree are only 6 cohorts, each named either 'one', 'two', 'three', 'four', 'five', or 'six'. This value is required. Each cohort should have a maximum of 110 distinct adids." + tests: + - not_null \ No newline at end of file diff --git a/chapter5/models/schema_completed.yml b/chapter5/models/schema_completed.yml deleted file mode 100644 index d229767..0000000 --- a/chapter5/models/schema_completed.yml +++ /dev/null @@ -1,35 +0,0 @@ - -version: 2 - -# To Do: -# 1. Include some of the built in dbt tests into the columns. -# 2. Create a custom dbt test to that will fail if any of the cohorts have more than 110 distinct adids. - -models: - - name: adid_data - columns: - - name: adid - description: "The advertisting ID for this data point. Every value in column should be a distinct ad_id. This value is required." - tests: - - unique - - not_null - - name: latitude - description: "The latitude of the data point. This value is required." - tests: - - not_null - - name: longitude - description: "The longitude of the data point. This value is required." - tests: - - not_null - - name: city - description: "The city of the data point. This value is required." - tests: - - not_null - - name: eventdate - description: "The date of the data point. This value is required." - tests: - - not_null - - name: cohort - description: "The cohort of the adid. Theree are only 6 cohorts, each named either 'one', 'two', 'three', 'four', 'five', or 'six'. This value is required. Each cohort should have a maximum of 110 distinct adids." - tests: - - not_null \ No newline at end of file