From: Harmon Date: Fri, 29 Jan 2021 02:33:36 +0000 (-0600) Subject: Replace API.geo_id id allowed_param with place_id parameter X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=78051e8a67b50cec5cacf53e0f9b315a53e16c4c;p=tweepy.git Replace API.geo_id id allowed_param with place_id parameter --- diff --git a/tests/test_api.py b/tests/test_api.py index b4abb16..a0e8eda 100644 --- a/tests/test_api.py +++ b/tests/test_api.py @@ -372,7 +372,7 @@ class TweepyAPITests(TweepyTestCase): return any(x.full_name.lower() == place_name.lower() for x in place_list) # Test various API functions using Austin, TX, USA - self.assertEqual(self.api.geo_id(id='1ffd3558f2e98349').full_name, 'Dogpatch, San Francisco') + self.assertEqual(self.api.geo_id(place_id='1ffd3558f2e98349').full_name, 'Dogpatch, San Francisco') self.assertTrue(place_name_in_list('Austin, TX', self.api.reverse_geocode(lat=30.2673701685, long= -97.7426147461))) # Austin, TX, USA diff --git a/tweepy/api.py b/tweepy/api.py index e958d81..1649d41 100644 --- a/tweepy/api.py +++ b/tweepy/api.py @@ -1253,15 +1253,14 @@ class API: 'max_results'], **kwargs ) - def geo_id(self, *args, **kwargs): + def geo_id(self, place_id, *args, **kwargs): """ :reference: https://developer.twitter.com/en/docs/geo/place-information/api-reference/get-geo-id-place_id - :allowed_param: 'id' + :allowed_param: """ return bind_api( *args, api=self, - path='/geo/id/{id}.json', - payload_type='place', - allowed_param=['id'], **kwargs + path=f'/geo/id/{place_id}.json', + payload_type='place', **kwargs ) def geo_search(self, *args, **kwargs):