Skip to content

Commit 6827645

Browse files
author
Justin Poehnelt
authored
fix: allow channel without client_id (#411)
1 parent a9460c0 commit 6827645

2 files changed

Lines changed: 2 additions & 8 deletions

File tree

googlemaps/client.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -130,13 +130,11 @@ def __init__(self, key=None, client_id=None, client_secret=None,
130130
raise ValueError("Invalid API key provided.")
131131

132132
if channel:
133-
if not client_id:
134-
raise ValueError("The channel argument must be used with a "
135-
"client ID")
136133
if not re.match("^[a-zA-Z0-9._-]*$", channel):
137134
raise ValueError("The channel argument must be an ASCII "
138135
"alphanumeric string. The period (.), underscore (_)"
139-
"and hyphen (-) characters are allowed.")
136+
"and hyphen (-) characters are allowed. If used without "
137+
"client_id, it must be 0-999.")
140138

141139
self.session = requests.Session()
142140
self.key = key

tests/test_client.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -280,10 +280,6 @@ def __call__(self, req):
280280

281281
self.assertEqual(2, len(responses.calls))
282282

283-
def test_channel_without_client_id(self):
284-
with self.assertRaises(ValueError):
285-
client = googlemaps.Client(key="AIzaasdf", channel="mychannel")
286-
287283
def test_invalid_channel(self):
288284
# Cf. limitations here:
289285
# https://developers.google.com/maps/premium/reports

0 commit comments

Comments
 (0)