From 137ebd94563554d33454383b3acbbabd3b5c0481 Mon Sep 17 00:00:00 2001 From: Daniel Roth Date: Mon, 20 Jul 2026 08:35:25 +0000 Subject: [PATCH] =?UTF-8?q?Treat=20a=20blank=20surveyor=20as=20unset=20whe?= =?UTF-8?q?n=20checking=20for=20booking=20amendments=20=F0=9F=9F=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Claude Fable 5 --- etl/hubspot/hubspot_deal_differ.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/etl/hubspot/hubspot_deal_differ.py b/etl/hubspot/hubspot_deal_differ.py index cf35a77da..60aece16c 100644 --- a/etl/hubspot/hubspot_deal_differ.py +++ b/etl/hubspot/hubspot_deal_differ.py @@ -320,7 +320,12 @@ class HubspotDealDiffer: new_survey_date = parse_hs_date(new_deal.get("confirmed_survey_date")) new_survey_time = new_deal.get("confirmed_survey_time") - new_surveyor = new_deal.get("third_party_surveyor_identifier") + # HubSpot sends "" for an unset property; the DB stores None. Treat + # them as the same so a booked deal doesn't amend on every scrape. + raw_surveyor = new_deal.get("third_party_surveyor_identifier") + new_surveyor = ( + raw_surveyor if raw_surveyor is not None and raw_surveyor.strip() else None + ) logger.info( "Abri job-amendment check: " "old_confirmed_survey_date=%s new_confirmed_survey_date=%s "