From ceda01b77fb5a13f74aaed97e2704727f1bfa4c2 Mon Sep 17 00:00:00 2001 From: Khalim Conn-Kowlessar Date: Tue, 20 Aug 2024 20:25:53 +0100 Subject: [PATCH] completed portfolio refresh --- etl/ownership/Ownership.py | 2 +- etl/ownership/projects/midlands_portfolio/app.py | 4 +--- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/etl/ownership/Ownership.py b/etl/ownership/Ownership.py index b05ef22a..3bc4b60d 100644 --- a/etl/ownership/Ownership.py +++ b/etl/ownership/Ownership.py @@ -1103,7 +1103,7 @@ class Ownership: # Step 2: Merge in the valuations data portfolio_properties = portfolio_properties.merge( - valuations, how="left", on="UPRN" + valuations.rename(columns={"uprn": "UPRN"}).drop(columns=['address', 'postcode']), how="left", on="UPRN" ) # Step 3: Store the final outputs diff --git a/etl/ownership/projects/midlands_portfolio/app.py b/etl/ownership/projects/midlands_portfolio/app.py index 19a52357..d004965f 100644 --- a/etl/ownership/projects/midlands_portfolio/app.py +++ b/etl/ownership/projects/midlands_portfolio/app.py @@ -171,9 +171,7 @@ def app(): # missed.to_csv("missed_valuations.csv") # We now need a distinct step to prepare final outputs - portfolio_timestamp = "2024-08-20 19:28:18.260205" - - exclusion_uprns = EXCLUDED_UPRNS + portfolio_timestamp = "2024-08-20 19:51:33.884145" # Create a date in the yyyy-mm-dd format to store the data against storage_date = datetime.datetime.now().strftime("%Y-%m-%d")