-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add iasWorld dbt tests and namespace all tests #236
Changes from 28 commits
aa1ad67
4d3c6ed
cdf2761
9f8eedc
047483e
47dfea3
2f93f33
a6d5a18
c7fb3c8
9bcdb38
4b6f096
ecf8bb5
10da78c
6d0145d
2d6d42f
4df8b13
5603526
b46b353
0b4daec
5f23d8f
2b4bf56
4d1ff64
f55f513
8d6486f
99c2ec2
c3ca076
3e2af4d
2e48f66
70b5902
c634f35
040b6bb
2ec996a
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,6 +12,13 @@ sources: | |
columns: | ||
- name: area | ||
description: '{{ doc("column_area") }}' | ||
tests: | ||
- dbt_utils.accepted_range: | ||
name: iasworld_addn_area_between_0_and_1.5M | ||
min_value: 0 | ||
max_value: 1500000 | ||
config: | ||
where: cur = 'Y' AND deactivat IS NULL | ||
- name: area_sqm | ||
description: Area of this line in meters | ||
- name: areaid | ||
|
@@ -20,20 +27,48 @@ sources: | |
description: '{{ doc("column_areasum") }}' | ||
- name: card | ||
description: '{{ doc("column_card") }}' | ||
tests: | ||
- not_null: | ||
name: iasworld_addn_card_not_null | ||
- dbt_utils.accepted_range: | ||
name: iasworld_addn_card_gte_1 | ||
min_value: 1 | ||
- name: cdu | ||
description: '{{ doc("column_cdu") }}' | ||
- name: chgrsn | ||
description: '{{ doc("column_chgrsn") }}' | ||
- name: class | ||
description: '{{ doc("shared_column_class") }}' | ||
tests: | ||
- relationships: | ||
name: iasworld_addn_class_in_ccao_class_dict | ||
to: source('ccao', 'class_dict') | ||
field: class_code | ||
config: | ||
where: | | ||
taxyr >= '2022' | ||
AND class != 'EX' | ||
AND cur = 'Y' | ||
AND deactivat IS NULL | ||
Comment on lines
+43
to
+53
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This test is on basically every |
||
- name: convaddn | ||
description: Converted addition total | ||
- name: cur | ||
description: '{{ doc("column_cur") }}' | ||
tests: | ||
- accepted_values: | ||
name: iasworld_addn_cur_in_accepted_values | ||
values: ['Y', 'D'] | ||
- name: deactivat | ||
description: '{{ doc("column_deactivat") }}' | ||
- name: depr | ||
description: Percent good from tables (based on age+cdu) | ||
tests: | ||
- dbt_utils.accepted_range: | ||
name: iasworld_addn_depr_between_0_and_100 | ||
min_value: 0 | ||
max_value: 100 | ||
config: | ||
where: cur = 'Y' AND deactivat IS NULL | ||
- name: eff_area | ||
description: Support value per line | ||
- name: effageovr | ||
|
@@ -64,6 +99,9 @@ sources: | |
description: '{{ doc("column_jur") }}' | ||
- name: lline | ||
description: '{{ doc("shared_column_lline") }}' | ||
tests: | ||
- not_null: | ||
name: iasworld_addn_lline_not_null | ||
- name: lower | ||
description: Lower level addition code | ||
- name: mktadj | ||
|
@@ -82,6 +120,13 @@ sources: | |
description: '{{ doc("column_newconpct") }}' | ||
- name: parid | ||
description: '{{ doc("shared_column_pin") }}' | ||
tests: | ||
- not_null: | ||
name: iasworld_addn_parid_not_null | ||
- relationships: | ||
name: iasworld_addn_parid_in_pardat_parid | ||
to: source('iasworld', 'pardat') | ||
field: parid | ||
- name: pctcomp | ||
description: '{{ doc("column_pctcomp") }}' | ||
- name: prodamage | ||
|
@@ -126,10 +171,21 @@ sources: | |
description: Second floor addition code | ||
- name: seq | ||
description: '{{ doc("shared_column_seq") }}' | ||
tests: | ||
- dbt_utils.sequential_values: | ||
name: iasworld_addn_seq_all_sequential_exist | ||
group_by_columns: | ||
- parid | ||
- taxyr | ||
- card | ||
- lline | ||
- name: status | ||
description: '{{ doc("column_status") }}' | ||
- name: taxyr | ||
description: '{{ doc("shared_column_year") }}' | ||
tests: | ||
- not_null: | ||
name: iasworld_addn_taxyr_not_null | ||
- name: third | ||
description: Third floor addition code | ||
- name: trans_id | ||
|
@@ -152,9 +208,10 @@ sources: | |
description: '{{ doc("column_whocalc") }}' | ||
- name: yrblt | ||
description: '{{ doc("column_yrblt") }}' | ||
|
||
tests: | ||
- unique_combination_of_columns: | ||
name: addn_unique_by_parid_taxyr_card_lline | ||
name: iasworld_addn_unique_by_parid_taxyr_card_lline | ||
combination_of_columns: | ||
- parid | ||
- taxyr | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,12 +17,35 @@ sources: | |
description: Applied market value | ||
- name: aprbldg | ||
description: Appraised building value | ||
tests: | ||
- dbt_utils.accepted_range: | ||
name: iasworld_aprval_aprbldg_between_0_and_1B | ||
min_value: 0 | ||
max_value: 1000000000 | ||
config: | ||
where: | | ||
taxyr >= '2021' | ||
AND cur = 'Y' | ||
AND deactivat IS NULL | ||
- name: aprdate | ||
description: '`APRTOT` calc date' | ||
- name: aprland | ||
description: Appraised land value | ||
tests: | ||
- dbt_utils.accepted_range: | ||
name: iasworld_aprval_aprland_between_0_and_1B | ||
min_value: 0 | ||
max_value: 1000000000 | ||
config: &unique-conditions | ||
where: cur = 'Y' AND deactivat IS NULL | ||
Comment on lines
+40
to
+41
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Since many tests require the same conditionals, I used YAML anchors a lot to repeat the same conditions across tests in the same schema file. |
||
- name: aprtot | ||
description: '{{ doc("column_aprtot") }}' | ||
tests: | ||
- dbt_utils.accepted_range: | ||
name: iasworld_aprval_aprtot_between_0_and_2B | ||
min_value: 0 | ||
max_value: 2000000000 | ||
config: *unique-conditions | ||
- name: areasum | ||
description: '{{ doc("column_areasum") }}' | ||
- name: assmkt | ||
|
@@ -31,6 +54,12 @@ sources: | |
description: Appraisal unit number | ||
- name: bldgval | ||
description: Building value | ||
tests: | ||
- dbt_utils.accepted_range: | ||
name: iasworld_aprval_bldgval_between_0_and_1B | ||
min_value: 0 | ||
max_value: 1000000000 | ||
config: *unique-conditions | ||
- name: comincval | ||
description: Commercial income value | ||
- name: commktsf | ||
|
@@ -65,6 +94,10 @@ sources: | |
description: Total cost value | ||
- name: cur | ||
description: '{{ doc("column_cur") }}' | ||
tests: | ||
- accepted_values: | ||
name: iasworld_aprval_cur_in_accepted_values | ||
values: ['Y', 'D'] | ||
- name: deactivat | ||
description: '{{ doc("column_deactivat") }}' | ||
- name: dwelval | ||
|
@@ -107,6 +140,12 @@ sources: | |
description: Land allocation percent | ||
- name: landval | ||
description: Total land cost value | ||
tests: | ||
- dbt_utils.accepted_range: | ||
name: iasworld_aprval_landval_between_0_and_1B | ||
min_value: 0 | ||
max_value: 1000000000 | ||
config: *unique-conditions | ||
- name: lastupd | ||
description: Date of last change to a value field | ||
- name: mandate | ||
|
@@ -135,6 +174,13 @@ sources: | |
description: '{{ doc("column_ovrmraval") }}' | ||
- name: parid | ||
description: '{{ doc("shared_column_pin") }}' | ||
tests: | ||
- not_null: | ||
name: iasworld_aprval_parid_not_null | ||
- relationships: | ||
name: iasworld_aprval_parid_in_pardat_parid | ||
to: source('iasworld', 'pardat') | ||
field: parid | ||
- name: posttype | ||
description: Assessment posting type | ||
- name: ppcomval | ||
|
@@ -177,6 +223,12 @@ sources: | |
description: Selected sale price | ||
- name: seq | ||
description: '{{ doc("shared_column_seq") }}' | ||
tests: | ||
- dbt_utils.sequential_values: | ||
name: iasworld_aprval_seq_all_sequential_exist | ||
group_by_columns: | ||
- parid | ||
- taxyr | ||
- name: spcflg | ||
description: Special processing flag | ||
- name: splitno | ||
|
@@ -189,6 +241,9 @@ sources: | |
description: '{{ doc("column_status") }}' | ||
- name: taxyr | ||
description: '{{ doc("shared_column_year") }}' | ||
tests: | ||
- not_null: | ||
name: iasworld_aprval_taxyr_not_null | ||
- name: tiebackbldg | ||
description: Sum of building value for all children in the income tieback group | ||
- name: tiebackland | ||
|
@@ -214,7 +269,7 @@ sources: | |
|
||
tests: | ||
- unique_combination_of_columns: | ||
name: aprval_unique_by_parid_taxyr | ||
name: iasworld_aprval_unique_by_parid_taxyr | ||
combination_of_columns: | ||
- parid | ||
- taxyr |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All changes in
default/
are related to namespace changes. See PR body for more details.