diff --git a/server/lib/python/cartodb_services/cartodb_services/mapbox/geocoder.py b/server/lib/python/cartodb_services/cartodb_services/mapbox/geocoder.py index 4966990..d6e24f6 100644 --- a/server/lib/python/cartodb_services/cartodb_services/mapbox/geocoder.py +++ b/server/lib/python/cartodb_services/cartodb_services/mapbox/geocoder.py @@ -66,6 +66,8 @@ class MapboxGeocoder(Traceable): if state_province: address.append(state_province) + country = [country] if country else None + try: response = self._geocoder.forward(address=', '.join(address), country=country, diff --git a/server/lib/python/cartodb_services/test/test_mapboxgeocoder.py b/server/lib/python/cartodb_services/test/test_mapboxgeocoder.py index 61a2f5f..9c5d8f0 100644 --- a/server/lib/python/cartodb_services/test/test_mapboxgeocoder.py +++ b/server/lib/python/cartodb_services/test/test_mapboxgeocoder.py @@ -29,3 +29,8 @@ class MapboxGeocoderTestCase(unittest.TestCase): place = self.geocoder.geocode(searchtext='Barcelona') assert place + + def test_valid_request_namedplace2(self): + place = self.geocoder.geocode(searchtext='New York', country='us') + + assert place