diff --git a/etl/eligibility/ha_15_32/ha_analysis_batch_3.py b/etl/eligibility/ha_15_32/ha_analysis_batch_3.py index bdf15917..e40bb98b 100644 --- a/etl/eligibility/ha_15_32/ha_analysis_batch_3.py +++ b/etl/eligibility/ha_15_32/ha_analysis_batch_3.py @@ -3305,11 +3305,18 @@ class DataLoader: ) else: # We have some examples, e.g. HA28, where we do not have the installed or cancelled column - survey_list["installation_status"] = np.where( - survey_list['INSTALL/ CANCELLATION DATE'].str.lower().str.contains("cancelled"), - "cancelled", - "installed", - ) + if 'INSTALL/ CANCELLATION DATE' in survey_list.columns: + survey_list["installation_status"] = np.where( + survey_list['INSTALL/ CANCELLATION DATE'].str.lower().str.contains("cancelled"), + "cancelled", + "installed", + ) + else: + survey_list["installation_status"] = np.where( + survey_list['INSTALL / CANCELLATION DATE'].str.lower().str.contains("cancelled"), + "cancelled", + "installed", + ) # Finally, for other cases, we set the status to "in progress" survey_list["installation_status"] = survey_list["installation_status"].fillna("in progress") @@ -5800,6 +5807,8 @@ def fml_data_pull(loader): "HA50", "HA24", "HA15", "HA32", "HA28", "HA6", "HA1", "HA107", "HA41", "HA48", "HA2", "HA63", "HA12", "HA117", "HA35", "HA34", "HA56", "HA19", "HA18", "HA9", "HA27", "HA30", "HA31", "HA54", "HA49", 'HA8', 'HA11', 'HA21', 'HA37', 'HA42', + # NEW - add property type + 'HA44', 'HA45', 'HA51', 'HA52' ] # Can't pull from EPC database because it's based in Scotland