From 57c8b1a99efa062bf2fe20acb59b553acafc71cd Mon Sep 17 00:00:00 2001 From: Will Thompson Date: Mon, 16 Mar 2026 13:19:28 +0000 Subject: [PATCH] fix: EalingCouncil/LondonBoroughEaling: Use collectionDate not collectionDateString These modules cannot parse the current data for my address, with the following error: > Failed setup, will retry: Unexpected error: unconverted data remains: > ,24/03/2026 (I do not know which of the two almost identical implementations I am using.) Looking at the council website's response to the POST request, included below after being pretty-printed with jq, the problem is that the garden waste bin has the following value for collectionDateString: "collectionDateString": "24/03/2026,24/03/2026", But the code expects this to contain a single date. Instead, use the collectionDate property, which contains a list of dates, and take the first element. (The council website instead splits the collectionDateString on comma.) Resolves https://github.com/robbrad/UKBinCollectionData/issues/1885 --- uk_bin_collection/uk_bin_collection/councils/EalingCouncil.py | 2 +- .../uk_bin_collection/councils/LondonBoroughEaling.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/uk_bin_collection/uk_bin_collection/councils/EalingCouncil.py b/uk_bin_collection/uk_bin_collection/councils/EalingCouncil.py index 9ca266df9f..35c2374790 100644 --- a/uk_bin_collection/uk_bin_collection/councils/EalingCouncil.py +++ b/uk_bin_collection/uk_bin_collection/councils/EalingCouncil.py @@ -35,7 +35,7 @@ def parse_data(self, page: str, **kwargs) -> dict: { "type": param["Service"], "collectionDate": datetime.strptime( - param["collectionDateString"], "%d/%m/%Y" + param["collectionDate"][0], "%d/%m/%Y" ).strftime(date_format), } ) diff --git a/uk_bin_collection/uk_bin_collection/councils/LondonBoroughEaling.py b/uk_bin_collection/uk_bin_collection/councils/LondonBoroughEaling.py index 85f3fbd56e..e312075466 100644 --- a/uk_bin_collection/uk_bin_collection/councils/LondonBoroughEaling.py +++ b/uk_bin_collection/uk_bin_collection/councils/LondonBoroughEaling.py @@ -38,7 +38,7 @@ def parse_data(self, page: str, **kwargs) -> dict: param2 = json_data["param2"] for service in param2: Bin_Type = service["Service"] - NextCollectionDate = service["collectionDateString"] + NextCollectionDate = service["collectionDate"][0] dict_data = { "type": Bin_Type, "collectionDate": datetime.strptime(