Merge pull request #610 from CartoDB/ch102254
HERE Bulk geocoder: Read all responses
This commit is contained in:
commit
f72dabd0a9
3
NEWS.md
3
NEWS.md
@ -1,9 +1,10 @@
|
|||||||
Nov 11th, 2020
|
Nov 18th, 2020
|
||||||
==============
|
==============
|
||||||
* Version `0.39.2` of the server extension
|
* Version `0.39.2` of the server extension
|
||||||
* Version `0.23.4` of the Python library
|
* Version `0.23.4` of the Python library
|
||||||
* Better messages on remote errors.
|
* Better messages on remote errors.
|
||||||
* Fix error on unknown status codes.
|
* Fix error on unknown status codes.
|
||||||
|
* Here bulk geocoder: Return also errors and no-matches.
|
||||||
|
|
||||||
Sep 23th, 2020
|
Sep 23th, 2020
|
||||||
==============
|
==============
|
||||||
|
@ -126,7 +126,7 @@ class HereMapsBulkGeocoder(HereMapsGeocoder, StreetPointBulkGeocoder):
|
|||||||
status=polling_root.find('./Response/Status').text)
|
status=polling_root.find('./Response/Status').text)
|
||||||
|
|
||||||
def _download_results(self, job_id):
|
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,
|
params=self.credentials_params,
|
||||||
timeout=(self.connect_timeout, self.read_timeout))
|
timeout=(self.connect_timeout, self.read_timeout))
|
||||||
root_zip = zipfile.ZipFile(io.BytesIO(result_r.content))
|
root_zip = zipfile.ZipFile(io.BytesIO(result_r.content))
|
||||||
@ -147,6 +147,9 @@ class HereMapsBulkGeocoder(HereMapsGeocoder, StreetPointBulkGeocoder):
|
|||||||
precision,
|
precision,
|
||||||
[match_type] if match_type else []
|
[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
|
return results
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user