Skip to content
Open
Show file tree
Hide file tree
Changes from 21 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 6 additions & 5 deletions dbt_project.yml
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
name: 'dbt_ngpvan'
version: '1.0.0'
name: "dbt_ngpvan"
version: "1.0.0"
config-version: 2

profile: 'dbt_ngpvan'
profile: "dbt_ngpvan"

model-paths: ["models"]
analysis-paths: ["analyses"]
test-paths: ["tests"]
seed-paths: ["seeds"]
macro-paths: ["macros"]
snapshot-paths: ["snapshots"]
docs-paths: ["documentation_blocks"]

target-path: "target"
clean-targets:
Expand All @@ -29,7 +30,7 @@ models:
+materialized: table

tests:
+severity: warn # all tests
+severity: warn # all tests

vars:
dbt_ngpvan_config:
Expand Down Expand Up @@ -60,4 +61,4 @@ vars:
lookup_tables: true
additional_fields: []
enable_incremental_models: true
ngpvan_default_incremental_window_days: 3
ngpvan_default_incremental_window_days: 3
3 changes: 3 additions & 0 deletions documentation_blocks/avvan_source_relation.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{% docs avvan_source_relation %}
Concatenated string of America Votes source database, schema and table. Null for values unrelated to America Votes data
{% enddocs %}
3 changes: 3 additions & 0 deletions documentation_blocks/bonterra_definitions/code_id.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{% docs code_id %}
Unique ID for Code

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same question about if we wanna add some disclaimer about multiple committees

{% enddocs %}
3 changes: 3 additions & 0 deletions documentation_blocks/bonterra_definitions/committee_id.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{% docs committee_id %}
Committee in which record lives
{% enddocs %}
3 changes: 3 additions & 0 deletions documentation_blocks/bonterra_missing.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{% docs bonterra_missing %}
Documentation for this column is not provided by Bonterra.
{% enddocs %}
3 changes: 3 additions & 0 deletions documentation_blocks/database_mode.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{% docs database_mode %}
Boolean to indicate if this row was synced via database
{% enddocs %}
3 changes: 3 additions & 0 deletions documentation_blocks/is_myvoters.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{% docs is_myvoters %}
Boolean to indicate if this row was synced via database
{% enddocs %}
3 changes: 3 additions & 0 deletions documentation_blocks/segment_by.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{% docs segment_by %}
The value used for segmentation
{% enddocs %}
3 changes: 3 additions & 0 deletions documentation_blocks/segment_by_key.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{% docs segment_by_key %}
Surrogate key identifying the segment of which this record is a part. Segments are then exposed to members according to data ownership and sharing arrangements.
{% enddocs %}
3 changes: 3 additions & 0 deletions documentation_blocks/source_schema.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{% docs source_schema %}
Denotes the schema component of the _dbt_source_relation field
{% enddocs %}
3 changes: 3 additions & 0 deletions documentation_blocks/source_table.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{% docs source_table %}
Denotes the table component of the _dbt_source_relation field
{% enddocs %}
3 changes: 3 additions & 0 deletions documentation_blocks/vendor.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{% docs vendor %}
Denotes the name of the vendor as it relates to TMC's segmentation processes
{% enddocs %}
3 changes: 3 additions & 0 deletions documentation_blocks/vendor_unique_id.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{% docs vendor_unique_id %}
Surrogate primary key uniquely identifying this record across all members data.
{% enddocs %}
19 changes: 19 additions & 0 deletions macros/custom_tests/test_table_fully_documented.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{% test table_fully_documented(model) %}
{% set table_name = model.identifier %}
SELECT
column_name
FROM
{{ model.database }}.{{ model.schema }}.INFORMATION_SCHEMA.COLUMN_FIELD_PATHS
WHERE
(description IS NULL OR description = '')
AND table_name = '{{ table_name }}'
UNION ALL
SELECT '{{ table_name }}'
FROM UNNEST([1]) AS dummy
WHERE NOT EXISTS (
SELECT 1
FROM {{ model.database }}.{{ model.schema }}.INFORMATION_SCHEMA.TABLE_OPTIONS
WHERE option_name = 'description'
AND table_name = '{{ table_name }}'
)
{% endtest %}
Loading