From d175e4294d9c69e39b86c2c2bb9648b5ffef0355 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ra=C3=BAl=20Mar=C3=ADn?= Date: Wed, 18 Nov 2020 16:26:07 +0100 Subject: [PATCH 1/2] Here bulk geocoder: Read also errors and no matches --- .../cartodb_services/here/bulk_geocoder.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/server/lib/python/cartodb_services/cartodb_services/here/bulk_geocoder.py b/server/lib/python/cartodb_services/cartodb_services/here/bulk_geocoder.py index ad71bfe..10397fc 100644 --- a/server/lib/python/cartodb_services/cartodb_services/here/bulk_geocoder.py +++ b/server/lib/python/cartodb_services/cartodb_services/here/bulk_geocoder.py @@ -126,7 +126,7 @@ class HereMapsBulkGeocoder(HereMapsGeocoder, StreetPointBulkGeocoder): status=polling_root.find('./Response/Status').text) def _download_results(self, job_id): - result_r = self.session.get("{}/{}/result".format(self.BATCH_URL, job_id), + result_r = self.session.get("{}/{}/all".format(self.BATCH_URL, job_id), params=self.credentials_params, timeout=(self.connect_timeout, self.read_timeout)) root_zip = zipfile.ZipFile(io.BytesIO(result_r.content)) @@ -147,6 +147,9 @@ class HereMapsBulkGeocoder(HereMapsGeocoder, StreetPointBulkGeocoder): precision, [match_type] if match_type else [] ))) - + elif row['matchLevel'] == 'NOMATCH': + results.append((row['recId'], [], {})) + elif row['matchLevel'] == 'FAILED': + results.append((row['recId'], [], {'error': 'Bulk geocoder failed'})) return results From 91da597bac3eb099e1f566d03199fb9b0244471e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ra=C3=BAl=20Mar=C3=ADn?= Date: Wed, 18 Nov 2020 16:28:14 +0100 Subject: [PATCH 2/2] Update NEWS --- NEWS.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/NEWS.md b/NEWS.md index 1b2287e..28affae 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,9 +1,10 @@ -Nov 11th, 2020 +Nov 18th, 2020 ============== * Version `0.39.2` of the server extension * Version `0.23.4` of the Python library * Better messages on remote errors. * Fix error on unknown status codes. + * Here bulk geocoder: Return also errors and no-matches. Sep 23th, 2020 ==============