|
6 | 6 | 'sql': """SELECT * FROM "housing-refined-zone"."tenure_reshape" where import_date=(select max(import_date) from "housing-refined-zone"."tenure_reshape") and description in ('Secure', 'Introductory', 'Mesne Profit Ac', 'Non-Secure') and (endoftenuredate is null or substr(endoftenuredate, 1, 11) = '1900-01-01')""", |
7 | 7 | 'id_field': 'tenancy_id'}, |
8 | 8 | 'contacts_reshape': { |
9 | | - 'sql': """SELECT id, targetid, createdat, contacttype, subtype, value, lastmodified, targettype, isactive, person_id, import_date FROM "housing-refined-zone"."contacts_reshape" where import_date=(select max(import_date) from "housing-refined-zone"."contacts_reshape") and isactive=True""", |
| 9 | + 'sql': """SELECT id, targetid, substr(createdat, 1, 10) as createdat, contacttype, subtype, value, substr(lastmodified, 1, 10) as lastmodified, targettype, isactive, person_id, import_date FROM "housing-refined-zone"."contacts_reshape" where import_date=(select max(import_date) from "housing-refined-zone"."contacts_reshape") and isactive=True""", |
10 | 10 | 'id_field': 'id'}, |
11 | 11 | 'housing_homeowner_record_sheet': { |
12 | 12 | 'sql': """SELECT * FROM "housing-raw-zone"."housing_homeowner_record_sheet" where import_date=(select max(import_date) from "housing-raw-zone"."housing_homeowner_record_sheet")""", |
|
16 | 16 | 'id_field': 'property_dwelling_reference_number'}, |
17 | 17 | 'assets_reshape': { |
18 | 18 | 'sql': """SELECT * FROM "housing-refined-zone"."assets_reshape" where import_date=(select max(import_date) from "housing-refined-zone"."assets_reshape") and assettype = 'Dwelling'""", |
19 | | - 'id_field': 'asset_id'} |
| 19 | + 'id_field': 'asset_id'}, |
| 20 | + 'matenancyagreement': { |
| 21 | + 'sql': """SELECT *, substr(cast(eot as varchar), 1, 10) as eot_parsed, substr(cast(cot as varchar), 1, 10) as cot_parsed FROM "housing-raw-zone"."sow2b_dbo_matenancyagreement" where import_date=(select max(import_date) FROM "housing-raw-zone"."sow2b_dbo_matenancyagreement")""", |
| 22 | + 'id_field': 'tag_ref'}, |
| 23 | + 'maproperty': { |
| 24 | + 'sql': """SELECT * FROM "housing-raw-zone"."sow2b_dbo_maproperty" where import_date=(select max(import_date) FROM "housing-raw-zone"."sow2b_dbo_maproperty")""", |
| 25 | + 'id_field': 'prop_ref'} |
20 | 26 | } |
21 | 27 |
|
22 | 28 | table_list = ['person_reshape', 'tenure_reshape', 'contacts_reshape', 'housing_homeowner_record_sheet', |
23 | | - 'housing_dwellings_list', 'assets_reshape'] |
| 29 | + 'housing_dwellings_list', 'assets_reshape', 'matenancyagreement', 'maproperty'] |
24 | 30 |
|
25 | 31 | partition_keys = ['import_year', 'import_month', 'import_day', 'import_date'] |
26 | 32 |
|
|
39 | 45 | 'expect_contact_value_column_values_to_be_unique': 'UNIQUENESS', |
40 | 46 | 'expect_contact_value_column_values_to_not_be_null': 'COMPLETENESS', |
41 | 47 | 'expect_date_of_birth_column_values_to_not_be_null': 'COMPLETENESS', |
42 | | - 'expect_date_of_birth_to_be_between': 'VALIDITY', |
| 48 | + 'expect_date_of_birth_to_be_between': 'TIMELINESS', |
43 | 49 | 'expect_description_values_to_be_in_set': 'CONSISTENCY', |
44 | 50 | 'expect_estate_ref_no_column_values_to_match_regex': 'VALIDITY', |
45 | 51 | 'expect_first_name_column_value_length': 'VALIDITY', |
| 52 | + 'expect_is_organisation_column_values_to_not_be_null': 'COMPLETENESS', |
| 53 | + 'expect_is_organisation_values_to_be_in_set': 'CONSISTENCY', |
46 | 54 | 'expect_llpg_and_prop_ref_column_values_to_be_unique_within_record': 'UNIQUENESS', |
47 | 55 | 'expect_llpg_column_value_lengths_between': 'VALIDITY', |
48 | 56 | 'expect_llpg_column_values_to_be_unique': 'UNIQUENESS', |
|
70 | 78 | 'expect_sub_type_column_values_to_not_be_null': 'COMPLETENESS', |
71 | 79 | 'expect_surname_column_value_length': 'VALIDITY', |
72 | 80 | 'expect_firstname_column_value_length': 'VALIDITY', |
| 81 | + 'expect_tag_ref_column_not_to_be_null': 'COMPLETENESS', |
73 | 82 | 'expect_target_id_and_value_column_values_to_be_unique_within_record': 'UNIQUENESS', |
74 | 83 | 'expect_target_id_column_values_to_not_be_null': 'COMPLETENESS', |
75 | 84 | 'expect_target_type_column_values_to_be_in_set': 'CONSISTENCY', |
|
78 | 87 | 'expect_tenancy_id_column_not_to_be_null': 'COMPLETENESS', |
79 | 88 | 'expect_tenure_code_column_not_to_be_null': 'COMPLETENESS', |
80 | 89 | 'expect_tenure_type_column_values_to_be_in_set': 'CONSISTENCY', |
| 90 | + 'expect_tenure_code_values_to_be_in_set': 'CONSISTENCY', |
81 | 91 | 'expect_uprn_column_value_lengths_between': 'VALIDITY', |
82 | 92 | 'expect_uprn_column_values_to_match_regex': 'VALIDITY', |
83 | 93 | 'expect_uprn_column_values_to_not_be_null': 'COMPLETENESS', |
|
0 commit comments