From 304f9fd0d37cef5b6676bafe07ae8c0905ffe6cb Mon Sep 17 00:00:00 2001 From: Javier Goizueta Date: Wed, 13 Mar 2019 13:40:02 +0100 Subject: [PATCH] Merge pull request #551 from CartoDB/tomtom-bulk-fix Fix altered public method of TomTomGeocoder --- NEWS.md | 5 +++++ .../cartodb_services/cartodb_services/tomtom/geocoder.py | 8 ++++++-- server/lib/python/cartodb_services/setup.py | 2 +- 3 files changed, 12 insertions(+), 3 deletions(-) diff --git a/NEWS.md b/NEWS.md index 5470a5b..d6a4455 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,3 +1,8 @@ +Mar 13rd, 2019 +============== +* Version `0.21.4` of the python library + * Fix TomTom bulk geocoder bug (#551) + Mar 5th, 2019 ============== * Version `0.21.3` of the python library diff --git a/server/lib/python/cartodb_services/cartodb_services/tomtom/geocoder.py b/server/lib/python/cartodb_services/cartodb_services/tomtom/geocoder.py index 5e1ac5b..81148ec 100644 --- a/server/lib/python/cartodb_services/cartodb_services/tomtom/geocoder.py +++ b/server/lib/python/cartodb_services/cartodb_services/tomtom/geocoder.py @@ -73,16 +73,20 @@ class TomTomGeocoder(Traceable): @qps_retry(qps=5, provider='tomtom') def geocode(self, searchtext, city=None, state_province=None, country=None): - geocoder_response, http_response = self.geocode_meta(searchtext, city, state_province, country) + geocoder_response, http_response = self._geocode_meta(searchtext, city, state_province, country) error_message = geocoder_response[1].get('error', None) if error_message: raise ServiceException(error_message, http_response) else: return geocoder_response[0] - @qps_retry(qps=5, provider='tomtom') def geocode_meta(self, searchtext, city=None, state_province=None, country=None): + return self._geocode_meta(searchtext, city, state_province, country)[0] + + @qps_retry(qps=5, provider='tomtom') + def _geocode_meta(self, searchtext, city=None, state_province=None, + country=None): if searchtext: searchtext = searchtext.decode('utf-8') if city: diff --git a/server/lib/python/cartodb_services/setup.py b/server/lib/python/cartodb_services/setup.py index d4f2a25..4a272ce 100644 --- a/server/lib/python/cartodb_services/setup.py +++ b/server/lib/python/cartodb_services/setup.py @@ -10,7 +10,7 @@ from setuptools import setup, find_packages setup( name='cartodb_services', - version='0.21.3', + version='0.21.4', description='CartoDB Services API Python Library',