backend was missing a dependency

This commit is contained in:
Jun-te Kim 2026-06-02 10:46:29 +00:00
parent f3ad339cf5
commit 144233a5f3
2 changed files with 7 additions and 3 deletions

View file

@ -120,8 +120,9 @@ def handler(
) -> dict[str, int]:
trigger = LandlordDescriptionOverridesTriggerBody.model_validate(body)
# The classifier reads the ORIGINAL upload (raw landlord headers), so the S3
# bucket comes from the trigger URI rather than a fixed env var.
# The classifier reads a dedicated CSV of the classifier columns (raw
# landlord headers preserved), converted from the upload by the frontend, so
# the S3 bucket comes from the trigger URI rather than a fixed env var.
bucket, _key = parse_s3_uri(trigger.s3_uri)
# boto3.client is overloaded per-service in the installed stubs; cast to Any
@ -136,7 +137,7 @@ def handler(
csv_client, bucket
)
# Raw rows, not load_batch: the original upload carries the description
# Raw rows, not load_batch: the classifier CSV carries the description
# columns but not the canonical address/postcode columns load_batch requires.
rows = csv_client.read_rows(trigger.s3_uri)

View file

@ -32,6 +32,9 @@ RUN pip install --no-cache-dir -r requirements.txt
COPY utils/ utils/
COPY backend/ backend/
COPY datatypes/ datatypes/
# main.py imports infrastructure.epc_client.epc_client_service (EpcClientService);
# without this the lambda fails at init with "No module named 'infrastructure'".
COPY infrastructure/ infrastructure/
# Copy the handler
COPY backend/address2UPRN/main.py .