From 0f892a69d989c45d219b70caa3465c4bafe58b6c Mon Sep 17 00:00:00 2001 From: Jun-te Kim Date: Wed, 1 Apr 2026 10:15:20 +0000 Subject: [PATCH] forgot json --- etl/hubspot/scripts/scraper/main.py | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/etl/hubspot/scripts/scraper/main.py b/etl/hubspot/scripts/scraper/main.py index 570461d7..d7f6add2 100644 --- a/etl/hubspot/scripts/scraper/main.py +++ b/etl/hubspot/scripts/scraper/main.py @@ -10,16 +10,25 @@ from etl.hubspot.hubspotClient import HubspotClient from etl.hubspot.hubspotDataTodB import HubspotDataToDb from typing import Any +import json # @subtask_handler() TODO: Do this without subtask_handler but task_handler() that creates task_id and subtask_id -def handler(event: dict[str, Any], context: Any, local: bool = False) -> None: +def handler(body: dict[str, Any], context: Any, local: bool = False) -> None: if local is True: - body = { - "hubspot_deal_id": "409487859944", + event = { + "Records": [ + { + "body": json.dumps( + { + "hubspot_deal_id": "409487859944", + } + ) + } + ] } - body = event["Records"][0]["body"] + body = json.loads(event["Records"][0]["body"]) hubspot_deal_id = body.get("hubspot_deal_id", "") if hubspot_deal_id == "":