Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
14 changes: 11 additions & 3 deletions scripts/jobs/housing/housing_nec_migration_apply_gx_dq_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ def main():
try:
df = pd.read_sql_query(sql_query, conn)
except Exception as e:
print(f"Problem found with {table}: {e}, skipping table.")
logger.info(f"Problem found with {table}: {e}, skipping table.")
continue

# set up batch
Expand Down Expand Up @@ -133,9 +133,17 @@ def main():

table_results_df["unexpected_id_list"] = pd.Series(dtype="object")
for i, row in query_df.iterrows():
table_results_df.loc[i, "unexpected_id_list"] = str(
try:
list(df[id_field].iloc[row["result.unexpected_index_list"]])
)
except Exception as e:
logger.info(
f"Problem found with {table}: {e}, skipping making unexpected_id_list."
Copy link
Contributor

Choose a reason for hiding this comment

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

A mixing use of logger.info and print

Copy link
Contributor Author

Choose a reason for hiding this comment

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

thank you for spotting - have updated

)
continue
else:
table_results_df.loc[i, "unexpected_id_list"] = str(
list(df[id_field].iloc[row["result.unexpected_index_list"]])
)

# drop columns not needed in metatdata
cols_to_drop_meta = [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,35 +41,35 @@ class ExpectTitleToBeInSet(gxe.ExpectColumnValuesToBeInSet):

class ExpectPeopleColumnsToMatchOrderedList(gxe.ExpectTableColumnsToMatchOrderedList):
column_list = [
"LPAR_TIN_HRV_TIR_CODE",
"LPAR_TIN_STAT_SUCCESSOR_IND",
"LPAR_TIN_START_DATE",
"LPAR_TIN_MAIN_TENANT_IND",
"LPAR_TIN_END_DATE",
"LPAR_TCY_IND",
"LPAR_HOP_START_DATE",
"LPAR_PER_SURNAME",
"LPAR_TCY_ALT_REF",
"LPAR_PHONE",
"LPAR_PER_FORENAME",
"LPAR_HOP_HPSR_CODE",
"LPAR_PER_TITLE",
"LPAR_PER_SURNAME",
"LPAR_PER_OTHER_NAME",
"LPAR_PER_NI_NO",
"LPAR_PER_INITIALS",
"LPAR_PER_HOU_OAP_IND",
"LPAR_PER_HOU_HRV_HMS_CODE",
"LPAR_PER_HOU_EMPLOYER",
"LPAR_PER_DATE_OF_BIRTH",
"LPAR_PER_HOU_DISABLED_IND",
"LPAR_PER_FRV_HGO_CODE",
"LPAR_PER_FRV_FNL_CODE",
"LPAR_PER_HOU_OAP_IND",
"LPAR_PER_FRV_FGE_CODE",
"LPAR_PER_FRV_FEO_CODE",
"LPAR_PER_FORENAME",
"LPAR_PER_DATE_OF_BIRTH",
"LPAR_PER_ALT_REF",
"LPAR_HOP_START_DATE",
"LPAR_HOP_HRV_REL_CODE",
"LPAR_HOP_HPSR_CODE",
"LPAR_HOP_HPER_CODE",
"LPAR_PER_HOU_EMPLOYER",
"LPAR_PER_HOU_HRV_HMS_CODE",
"LPAR_PHONE",
"LPAR_HOP_END_DATE",
"LPAR_HOP_HPER_CODE",
"LPAR_TCY_IND",
"LPAR_TIN_MAIN_TENANT_IND",
"LPAR_TIN_START_DATE",
"LPAR_TIN_END_DATE",
"PAR_TIN_HRV_TIR_CODE",
"LPAR_TIN_STAT_SUCCESSOR_IND",
"LPAR_PER_ALT_REF",
"LPAR_PER_FRV_FEO_CODE",
"LPAR_PER_NI_NO",
"LPAR_PER_FRV_HGO_CODE",
"LPAR_PER_FRV_FNL_CODE",
"LPAR_PER_OTHER_NAME",
]
description: str = "Expect people load columns to match ordered list exactly"

Expand Down