#!/usr/bin/env python3 """POST a single SQS-shaped event at the locally-running splitter Lambda. The container built by docker-compose runs the AWS Lambda Runtime Interface Emulator, which accepts invocations on the URL below. Replace the three placeholder values with a real parent Task id, the splitter's own SubTask id (both must already exist in the Postgres pointed at by .env.local), and the s3://... URI of an uploaded address CSV. """ import json import requests HOST = "localhost" PORT = "9001" LAMBDA_URL = f"http://{HOST}:{PORT}/2015-03-31/functions/function/invocations" payload = { "Records": [ { "body": json.dumps( { "task_id": "f4b3332f-c0cc-481f-96a5-d39860a647cf", "sub_task_id": "14c042de-40c4-473b-8cd8-72c983a94a8d", "s3_uri": "s3://retrofit-data-dev/ara_raw_inputs/calico/Calico Homes Full list EPC Properties(Sheet2) (1) (1).csv", } ) } ] } response = requests.post(LAMBDA_URL, json=payload) print("Status code:", response.status_code) print("Response:") print(response.text)