From 54a4d5761aeda930c8153996eebc1edaea6bded6 Mon Sep 17 00:00:00 2001 From: Jun-te Kim Date: Mon, 22 Sep 2025 09:26:30 +0000 Subject: [PATCH] kevin changed stone water --- deployment/lambda/walthamforest_etl/docker/app.py | 8 ++++++-- etl/month_end_automation_wave_2_no_4.py | 4 ++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/deployment/lambda/walthamforest_etl/docker/app.py b/deployment/lambda/walthamforest_etl/docker/app.py index 9364cda..664ad2d 100644 --- a/deployment/lambda/walthamforest_etl/docker/app.py +++ b/deployment/lambda/walthamforest_etl/docker/app.py @@ -235,6 +235,7 @@ def handler(event, context): for house in houses: print(house["UPRN"]) json_uri = upload_json_to_s3(house, generate_file_uri(house["UPRN"])) + # read data for flats assets = process_complex("Chingford Rd 236-256 Properties") simple = process_complex("CHINGFORD ROAD 236-254 Asset Bl", "BLOCK_CODE") @@ -247,8 +248,11 @@ def handler(event, context): house.update({"UPRN": uprn_mapping[pseudo_name.upper()]}) - with open("flat.json", "w") as f: - json.dump(houses[0], f, indent=2, ensure_ascii=False, default=_json_default) + for house in flats: + print(house["UPRN"]) + json_uri = upload_json_to_s3(house, generate_file_uri(house["UPRN"])) + # with open("flat.json", "w") as f: + # json.dump(houses[0], f, indent=2, ensure_ascii=False, default=_json_default) diff --git a/etl/month_end_automation_wave_2_no_4.py b/etl/month_end_automation_wave_2_no_4.py index 787aede..9d2f567 100644 --- a/etl/month_end_automation_wave_2_no_4.py +++ b/etl/month_end_automation_wave_2_no_4.py @@ -173,7 +173,7 @@ filtered_dfs.append(_) # POST EPC post_epc = df[ - df["post epc"].str.lower().isin(["completed & uploaded"]) + df["post epc/epr"].str.lower().isin(["completed & uploaded"]) ].copy() post_epc["job_type"] = "POST EPC" filtered_dfs.append(post_epc) @@ -181,7 +181,7 @@ filtered_dfs.append(post_epc) # POST EPR post_epr = df[ - df["post epc"].str.lower().isin(["post epr completed"]) + df["post epc/epr"].str.lower().isin(["post epr completed"]) ].copy() post_epr["job_type"] = "POST EPR" filtered_dfs.append(post_epr)