Skip to content

Commit c92f346

Browse files
committed
Amend GX test for people data load column ordering; add error handling for main apply script
1 parent a68734f commit c92f346

File tree

2 files changed

+32
-24
lines changed

2 files changed

+32
-24
lines changed

scripts/jobs/housing/housing_nec_migration_apply_gx_dq_tests.py

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -133,9 +133,17 @@ def main():
133133

134134
table_results_df["unexpected_id_list"] = pd.Series(dtype="object")
135135
for i, row in query_df.iterrows():
136-
table_results_df.loc[i, "unexpected_id_list"] = str(
136+
try:
137137
list(df[id_field].iloc[row["result.unexpected_index_list"]])
138-
)
138+
except Exception as e:
139+
print(
140+
f"Problem found with {table}: {e}, skipping making unexpected_id_list."
141+
)
142+
continue
143+
else:
144+
table_results_df.loc[i, "unexpected_id_list"] = str(
145+
list(df[id_field].iloc[row["result.unexpected_index_list"]])
146+
)
139147

140148
# drop columns not needed in metatdata
141149
cols_to_drop_meta = [

scripts/jobs/housing/housing_nec_migration_people_data_load_gx_suite.py

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -41,35 +41,35 @@ class ExpectTitleToBeInSet(gxe.ExpectColumnValuesToBeInSet):
4141

4242
class ExpectPeopleColumnsToMatchOrderedList(gxe.ExpectTableColumnsToMatchOrderedList):
4343
column_list = [
44-
"LPAR_TIN_HRV_TIR_CODE",
45-
"LPAR_TIN_STAT_SUCCESSOR_IND",
46-
"LPAR_TIN_START_DATE",
47-
"LPAR_TIN_MAIN_TENANT_IND",
48-
"LPAR_TIN_END_DATE",
49-
"LPAR_TCY_IND",
44+
"LPAR_HOP_START_DATE",
45+
"LPAR_PER_SURNAME",
5046
"LPAR_TCY_ALT_REF",
51-
"LPAR_PHONE",
47+
"LPAR_PER_FORENAME",
48+
"LPAR_HOP_HPSR_CODE",
5249
"LPAR_PER_TITLE",
53-
"LPAR_PER_SURNAME",
54-
"LPAR_PER_OTHER_NAME",
55-
"LPAR_PER_NI_NO",
5650
"LPAR_PER_INITIALS",
57-
"LPAR_PER_HOU_OAP_IND",
58-
"LPAR_PER_HOU_HRV_HMS_CODE",
59-
"LPAR_PER_HOU_EMPLOYER",
51+
"LPAR_PER_DATE_OF_BIRTH",
6052
"LPAR_PER_HOU_DISABLED_IND",
61-
"LPAR_PER_FRV_HGO_CODE",
62-
"LPAR_PER_FRV_FNL_CODE",
53+
"LPAR_PER_HOU_OAP_IND",
6354
"LPAR_PER_FRV_FGE_CODE",
64-
"LPAR_PER_FRV_FEO_CODE",
65-
"LPAR_PER_FORENAME",
66-
"LPAR_PER_DATE_OF_BIRTH",
67-
"LPAR_PER_ALT_REF",
68-
"LPAR_HOP_START_DATE",
6955
"LPAR_HOP_HRV_REL_CODE",
70-
"LPAR_HOP_HPSR_CODE",
71-
"LPAR_HOP_HPER_CODE",
56+
"LPAR_PER_HOU_EMPLOYER",
57+
"LPAR_PER_HOU_HRV_HMS_CODE",
58+
"LPAR_PHONE",
7259
"LPAR_HOP_END_DATE",
60+
"LPAR_HOP_HPER_CODE",
61+
"LPAR_TCY_IND",
62+
"LPAR_TIN_MAIN_TENANT_IND",
63+
"LPAR_TIN_START_DATE",
64+
"LPAR_TIN_END_DATE",
65+
"PAR_TIN_HRV_TIR_CODE",
66+
"LPAR_TIN_STAT_SUCCESSOR_IND",
67+
"LPAR_PER_ALT_REF",
68+
"LPAR_PER_FRV_FEO_CODE",
69+
"LPAR_PER_NI_NO",
70+
"LPAR_PER_FRV_HGO_CODE",
71+
"LPAR_PER_FRV_FNL_CODE",
72+
"LPAR_PER_OTHER_NAME",
7373
]
7474
description: str = "Expect people load columns to match ordered list exactly"
7575

0 commit comments

Comments
 (0)