From c40c991320f0cd3b0f2bfe2b728f5f2cf0c5c7ae Mon Sep 17 00:00:00 2001 From: Jun-te Kim Date: Tue, 17 Jun 2025 08:12:41 +0000 Subject: [PATCH] more robost --- etl/dimitra_hubspot_notes_gather.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/etl/dimitra_hubspot_notes_gather.py b/etl/dimitra_hubspot_notes_gather.py index 39b970d..ec364e0 100644 --- a/etl/dimitra_hubspot_notes_gather.py +++ b/etl/dimitra_hubspot_notes_gather.py @@ -72,7 +72,11 @@ for pipeline in pipelines.results: week_label = get_week_label(note["created_at"]) if not week_label: continue - html_body = note['note'] + html_body = note.get('note') + if not html_body: + print(f"Skipping note with missing 'note' field: {note}") + continue + print(f"Debugging purposes html_body looks like {html_body}") soup = BeautifulSoup(html_body, "html.parser") plain_text = soup.get_text(separator="\n") @@ -92,7 +96,7 @@ for pipeline in pipelines.results: notes_data[pipeline_name].append({ "Deal Name": deal_name.upper(), - "Deal URL": f"https://app-eu1.hubspot.com/contacts/{portal_id}/record/0-3/{deals["deal_id"]}/", + "Deal URL": f"https://app-eu1.hubspot.com/contacts/{portal_id}/record/0-3/{deals['deal_id']}/", "Deal Owner": owner_name, "Deal Stage": stage.label.upper(), "Value": deals["value"],