From 3b989b249451f2d392a3b0f1f3db69f26acaa694 Mon Sep 17 00:00:00 2001 From: Daniel Roth Date: Fri, 17 Apr 2026 13:18:01 +0000 Subject: [PATCH 1/2] correctly trigger pashub fetcher --- etl/hubspot/scripts/scraper/main.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/etl/hubspot/scripts/scraper/main.py b/etl/hubspot/scripts/scraper/main.py index e6c788ea..9fe08889 100644 --- a/etl/hubspot/scripts/scraper/main.py +++ b/etl/hubspot/scripts/scraper/main.py @@ -104,10 +104,10 @@ def _trigger_pashub_fetcher(sqs_client: Any, hubspot_deal: Dict[str, str]) -> No message_body: Dict[str, Optional[str]] = { "pashub_link": hubspot_deal["pashub_link"], "address": None, # potentially available from Listing, leave as None for now - "sharepoint_link": hubspot_deal["sharepoint_link"], - "uprn": hubspot_deal["national_uprn"], - "landlord_property_id": hubspot_deal["owner_property_id"], - "deal_stage": hubspot_deal["deal_stage"], + "sharepoint_link": hubspot_deal.get("sharepoint_link", None), + "uprn": hubspot_deal.get("national_uprn", None), + "landlord_property_id": hubspot_deal.get("owner_property_id", None), + "deal_stage": hubspot_deal.get("deal_stage", None), } response = sqs_client.send_message( From d92f035b64e5bf0cbf57c83ede352e95db30bf25 Mon Sep 17 00:00:00 2001 From: Daniel Roth Date: Fri, 17 Apr 2026 13:28:01 +0000 Subject: [PATCH 2/2] corrections to coordination strings --- etl/hubspot/hubspot_deal_differ.py | 12 ++++++------ etl/hubspot/scripts/scraper/main.py | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/etl/hubspot/hubspot_deal_differ.py b/etl/hubspot/hubspot_deal_differ.py index b95b544c..f4ece663 100644 --- a/etl/hubspot/hubspot_deal_differ.py +++ b/etl/hubspot/hubspot_deal_differ.py @@ -6,9 +6,9 @@ from etl.hubspot.utils import parse_hs_date class HubspotDealDiffer: COORDINATION_COMPLETE: List[str] = [ - "v1 ioe/mtp complete", - "v2 ioe/mtp complete", - "v3 ioe/mtp complete", + "(v1) ioe/mtp complete", + "(v2) ioe/mtp complete", + "(v3) ioe/mtp complete", ] RETROFIT_DESIGN_COMPLETE = "uploaded" LODGEMENT_COMPLETE: List[str] = ["lodgement complete", "measures lodged"] @@ -152,7 +152,7 @@ class HubspotDealDiffer: new_status: str = new_deal.get("coordination_status", "") return ( new_status != "" - and new_status in HubspotDealDiffer.COORDINATION_COMPLETE + and new_status.lower() in HubspotDealDiffer.COORDINATION_COMPLETE and new_status != old_deal.coordination_status ) @@ -161,7 +161,7 @@ class HubspotDealDiffer: new_status: str = new_deal.get("design_status", "") return ( new_status != "" - and new_status == HubspotDealDiffer.RETROFIT_DESIGN_COMPLETE + and new_status.lower() == HubspotDealDiffer.RETROFIT_DESIGN_COMPLETE and new_status != old_deal.design_status ) @@ -172,6 +172,6 @@ class HubspotDealDiffer: new_status: str = new_deal.get("lodgement_status", "") return ( new_status != "" - and new_status in HubspotDealDiffer.LODGEMENT_COMPLETE + and new_status.lower() in HubspotDealDiffer.LODGEMENT_COMPLETE and new_status != old_deal.lodgement_status ) diff --git a/etl/hubspot/scripts/scraper/main.py b/etl/hubspot/scripts/scraper/main.py index 9fe08889..f7dc1076 100644 --- a/etl/hubspot/scripts/scraper/main.py +++ b/etl/hubspot/scripts/scraper/main.py @@ -121,5 +121,5 @@ def _trigger_pashub_fetcher(sqs_client: Any, hubspot_deal: Dict[str, str]) -> No if __name__ == "__main__": - handler({"hubspot_deal_id": "371470706915"}, "") + handler({"hubspot_deal_id": "498926855369"}, "") print("beep")