Skip to content

Commit 45c7827

Browse files
authored
Make Epidata.sensors.auth optional
Removes `auth` from argument requirements, and adds it to the request params only if specified. Fixes #49
1 parent 9ab7840 commit 45c7827

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/client/delphi_epidata.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -499,16 +499,17 @@ def delphi(system, epiweek):
499499
def sensors(auth, names, locations, epiweeks):
500500
"""Fetch Delphi's digital surveillance sensors."""
501501
# Check parameters
502-
if auth is None or names is None or locations is None or epiweeks is None:
503-
raise Exception('`auth`, `names`, `locations`, and `epiweeks` are all required')
502+
if names is None or locations is None or epiweeks is None:
503+
raise Exception('`names`, `locations`, and `epiweeks` are all required')
504504
# Set up request
505505
params = {
506506
'endpoint': 'sensors',
507-
'auth': auth,
508507
'names': Epidata._list(names),
509508
'locations': Epidata._list(locations),
510509
'epiweeks': Epidata._list(epiweeks),
511510
}
511+
if auth is not None:
512+
params['auth'] = auth
512513
# Make the API call
513514
return Epidata._request(params)
514515

0 commit comments

Comments
 (0)