-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathiasworld.pardat.yml
381 lines (378 loc) · 14.9 KB
/
iasworld.pardat.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
sources:
- name: iasworld
loaded_at_field: date_parse(loaded_at, '%Y-%m-%d %H:%i:%S.%f')
tags:
- load_auto
- test_qc_iasworld
tables:
- name: pardat
description: '{{ doc("table_pardat") }}'
freshness:
filter: taxyr >= date_format(current_date - interval '1' year, '%Y')
warn_after: {count: 24, period: hour}
error_after: {count: 48, period: hour}
columns:
- name: acres
description: '{{ doc("column_acres") }}'
- name: addrsrc
description: Address source
- name: addrvalid
description: '{{ doc("column_addrvalid") }}'
- name: adjfact
description: '{{ doc("column_adjfact") }}'
- name: adradd
description: '{{ doc("column_adradd") }}'
- name: adrdir
description: '{{ doc("column_adrdir") }}'
- name: adrid
description: '{{ doc("column_adrid") }}'
- name: adrno
description: '{{ doc("column_adrno") }}'
- name: adrparchild
description: '{{ doc("column_adrparchild") }}'
- name: adrpostmod
description: '{{ doc("column_adrpostmod") }}'
- name: adrpre
description: '{{ doc("column_adrpre") }}'
- name: adrpremod
description: '{{ doc("column_adrpremod") }}'
- name: adrpretype
description: '{{ doc("column_adrpretype") }}'
- name: adrstatus
description: '{{ doc("column_adrstatus") }}'
- name: adrstr
description: '{{ doc("column_adrstr") }}'
- name: adrsuf
description: '{{ doc("column_adrsuf") }}'
- name: adrsuf2
description: '{{ doc("column_adrsuf2") }}'
- name: afar
description: Actual FAR (calculated)
- name: afarsf
description: Square feet of actual FAR (calculated)
- name: aguse
description: Agriculture use
- name: alt_id
description: Alternate parcel identification
- name: areacd
description: Area code used as part of Folio number (BCA)
- name: assessorid
description: Assessor assigned to this parcel
- name: bldgros_d
description: Gross building description
- name: bldgros_v
description: Gross building value
- name: block
description: Parcel block
- name: calcacres
description: Total acres calculated from LAND table
- name: chgrsn
description: '{{ doc("column_chgrsn") }}'
- name: cityname
description: '{{ doc("column_cityname") }}'
- name: class
description: '{{ doc("shared_column_class") }}'
tests:
- relationships:
name: iasworld_pardat_class_in_ccao_class_dict
to: source('ccao', 'class_dict')
field: class_code
additional_select_columns: &select-columns
- taxyr
- parid
- who
- wen
config:
where: |
CAST(taxyr AS int) BETWEEN {{ var('test_qc_year_start') }} AND {{ var('test_qc_year_end') }}
AND class NOT IN ('EX', 'RR')
AND NOT REGEXP_LIKE(class, '[0-9]{3}[A|B]')
AND cur = 'Y'
AND deactivat IS NULL
meta:
category: class_mismatch_or_issue
description: class_code should be valid
- expression_is_true:
name: iasworld_pardat_class_equals_luc
expression: '= luc'
additional_select_columns:
- taxyr
- parid
- who
- wen
- luc
config: &unique-conditions
where: |
CAST(taxyr AS int) BETWEEN {{ var('test_qc_year_start') }} AND {{ var('test_qc_year_end') }}
AND cur = 'Y'
AND deactivat IS NULL
meta:
category: class_mismatch_or_issue
description: class should be the same as luc
- name: cur
description: '{{ doc("column_cur") }}'
tests:
- accepted_values:
name: iasworld_pardat_cur_in_accepted_values
values: ['Y', 'D']
additional_select_columns: *select-columns
config:
where: |
CAST(taxyr AS int) BETWEEN {{ var('test_qc_year_start') }} AND {{ var('test_qc_year_end') }}
meta:
description: cur should be 'Y' or 'D'
- name: deactivat
description: '{{ doc("column_deactivat") }}'
- name: farminc
description: Farm income
- name: fldref
description: Field reference code
- name: floorno
description: '{{ doc("column_floorno") }}'
- name: fronting
description: Fronting location factor (street)
- name: iasw_id
description: '{{ doc("column_iasw_id") }}'
- name: jur
description: '{{ doc("column_jur") }}'
- name: juris
description: Jurisdiction
- name: landisc
description: Landisc frame number
- name: livunit
description: Number of living units
- name: loaded_at
description: '{{ doc("shared_column_loaded_at") }}'
- name: loc2
description: '{{ doc("column_loc2") }}'
- name: location
description: Location factor (area type)
- name: luc
description: '{{ doc("column_luc") }}'
- name: lucmult
description: Multiple land use flag
- name: mappre
description: Map/Routing map prefix number
- name: mapsuf
description: Map/Routing map suffix number
- name: mscbld_n
description: Number of miscellaneous buildings
- name: mscbld_v
description: Adjusted miscellaneous buildings value
- name: muni
description: Municipality
- name: municd
description: Jurisdictions (Municipalities) used as part of Folio number (BCA)
- name: nbhd
description: '{{ doc("shared_column_nbhd_code") }}'
tests:
- row_values_match_after_join:
name: iasworld_pardat_nbhd_matches_legdat_township
external_model: source('iasworld', 'legdat')
external_column_name: user1
column_alias: nbhd_code
external_column_alias: township_code
additional_select_columns:
- model.taxyr
- model.parid
- model.who
- model.wen
join_condition:
ON substr(model.nbhd, 1, 2) != external_model.user1
AND model.parid = external_model.parid
AND model.taxyr = external_model.taxyr
AND external_model.cur = 'Y'
AND external_model.deactivat IS NULL
config: *unique-conditions
meta:
category: relationships
description: nbhd code first 2 digits should match legdat.user1 (township code)
- name: nbhdie
description: Neighborhood income valuation
- name: nonfarminc
description: Non-farm income
- name: notecd1
description: Code for predefined note 1
- name: notecd2
description: Code for predefined note 2
- name: nrinc
description: Natural resource income
- name: ofcard
description: Number of main buildings (cards)
- name: ovrassessorid
description: Override assessor assigned to this parcel
- name: parid
description: '{{ doc("shared_column_pin") }}'
- name: parkprox
description: Parking proximity
- name: parkquanit
description: Parking quantity
- name: parktype
description: Parking type
- name: partial
description: '{{ doc("column_partial") }}'
- name: pctown
description: '{{ doc("column_pctown") }}'
- name: pfar
description: Proffered FAR (user entered)
- name: pfarsf
description: Square feet of proffered FAR (user entered)
- name: postalcode
description: '{{ doc("column_postalcode") }}'
- name: prefactmscbld
description: Misc bldg value before adj factor is applied
- name: procdate
description: '{{ doc("column_procdate") }}'
- name: procname
description: '{{ doc("column_procname") }}'
- name: rectype
description: '{{ doc("column_rectype") }}'
- name: restrict1
description: Restriction 1
- name: restrict2
description: Restriction 2
- name: restrict3
description: Restriction 3
- name: rollno
description: Roll number used as part of Folio number (BCA)
- name: rtepre
description: Map/Routing routing prefix number
- name: rtesuf
description: Map/Routing routing suffix number
- name: salekey
description: '{{ doc("column_salekey") }}'
- name: sec_fld
description: Security field
- name: seq
description: '{{ doc("shared_column_seq") }}'
tests:
- sequential_values:
name: iasworld_pardat_seq_all_sequential_exist
group_by_columns:
- parid
- taxyr
additional_select_columns:
- who
- wen
config: *unique-conditions
meta:
description: seq should be sequential
- name: skip_addr_validation
description: '{{ doc("column_skip_addr_validation") }}'
- name: splitno
description: '{{ doc("column_splitno") }}'
- name: spot
description: Spot location percentage adj./land value
- name: statecode
description: '{{ doc("column_statecode") }}'
- name: status
description: '{{ doc("column_status") }}'
- name: strcd
description: '{{ doc("column_strcd") }}'
- name: street1
description: Street and sidewalk code 1
- name: street2
description: Street and sidewalk code 2
- name: strreloc
description: '{{ doc("column_strreloc") }}'
- name: taxyr
description: '{{ doc("shared_column_year") }}'
- name: tieback
description: '{{ doc("shared_column_tieback_key_pin") }}'
tests:
- expression_is_true:
name: iasworld_pardat_tieback_does_not_contain_hyphen
expression: not like '%-%'
additional_select_columns: *select-columns
config: *unique-conditions
meta:
category: incorrect_values
description: tieback should not contain hyphens
- name: tiebkcd
description: Tieback code
- name: tiebldgpct
description: '{{ doc("shared_column_tieback_proration_rate") }}'
- name: tielandpct
description: Percent land common interest
- name: topo1
description: Topography code 1
- name: topo2
description: Topography code 2
- name: topo3
description: Topography code 3
- name: traffic
description: Traffic code
- name: trans_id
description: '{{ doc("column_trans_id") }}'
- name: unit
description: '{{ doc("column_unit") }}'
- name: unitdesc
description: '{{ doc("column_unitdesc") }}'
- name: unitno
description: '{{ doc("column_unitno") }}'
- name: upd_status
description: '{{ doc("column_upd_status") }}'
- name: util1
description: Utility code 1
- name: util2
description: Utility code 2
- name: util3
description: Utility code 3
- name: wen
description: '{{ doc("shared_column_updated_at") }}'
- name: wencalc
description: '{{ doc("column_wencalc") }}'
- name: who
description: '{{ doc("shared_column_updated_by") }}'
- name: whocalc
description: '{{ doc("column_whocalc") }}'
- name: zfar
description: Zoned FAR, from LP53
- name: zip1
description: '{{ doc("column_zip1") }}'
- name: zip2
description: '{{ doc("column_zip2") }}'
tests:
- column_is_subset_of_external_column:
name: iasworld_pardat_nbhd_matches_spatial_town_nbhd
column: nbhd
external_model: spatial.neighborhood
external_column: town_nbhd
additional_select_columns: *select-columns
config:
# Codes ending in 999 are dummy codes used for some purpose,
# although we do not yet know what it is
where: |
(taxyr BETWEEN '2010' AND CAST(YEAR(NOW()) AS varchar))
AND (nbhd NOT LIKE '%999')
meta:
category: relationships
description: nbhd code not valid
- unique_combination_of_columns:
name: iasworld_pardat_unique_by_parid_taxyr
combination_of_columns:
- parid
- taxyr
additional_select_columns:
- column: who
alias: who
agg_func: array_agg
- column: wen
alias: wen
agg_func: array_agg
config: *unique-conditions
meta:
description: pardat should be unique by parid and taxyr
- expression_is_true:
name: iasworld_pardat_adrno_length_lte_5
expression: LENGTH(CAST(adrno AS varchar)) <= 5
additional_select_columns:
- parid
- taxyr
- who
- wen
- adrno
config: *unique-conditions
meta:
category: column_length
description: adrno should be <= 5 characters long