Merge pull request #551 from CartoDB/tomtom-bulk-fix

Fix altered public method of TomTomGeocoder
This commit is contained in:
Javier Goizueta 2019-03-13 13:40:02 +01:00
parent dc0b3191f6
commit 304f9fd0d3
3 changed files with 12 additions and 3 deletions

View File

@ -1,3 +1,8 @@
Mar 13rd, 2019
==============
* Version `0.21.4` of the python library
* Fix TomTom bulk geocoder bug (#551)
Mar 5th, 2019 Mar 5th, 2019
============== ==============
* Version `0.21.3` of the python library * Version `0.21.3` of the python library

View File

@ -73,16 +73,20 @@ class TomTomGeocoder(Traceable):
@qps_retry(qps=5, provider='tomtom') @qps_retry(qps=5, provider='tomtom')
def geocode(self, searchtext, city=None, state_province=None, def geocode(self, searchtext, city=None, state_province=None,
country=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) error_message = geocoder_response[1].get('error', None)
if error_message: if error_message:
raise ServiceException(error_message, http_response) raise ServiceException(error_message, http_response)
else: else:
return geocoder_response[0] return geocoder_response[0]
@qps_retry(qps=5, provider='tomtom')
def geocode_meta(self, searchtext, city=None, state_province=None, def geocode_meta(self, searchtext, city=None, state_province=None,
country=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: if searchtext:
searchtext = searchtext.decode('utf-8') searchtext = searchtext.decode('utf-8')
if city: if city:

View File

@ -10,7 +10,7 @@ from setuptools import setup, find_packages
setup( setup(
name='cartodb_services', name='cartodb_services',
version='0.21.3', version='0.21.4',
description='CartoDB Services API Python Library', description='CartoDB Services API Python Library',