Skip to content

Commit 76d5436

Browse files
committed
suggested change
1 parent 783ab24 commit 76d5436

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

nhsn/delphi_nhsn/pull.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -74,13 +74,11 @@ def pull_data(socrata_token: str, dataset_id: str, logger):
7474
results = []
7575
offset = 0
7676
limit = 50000 # maximum limit allowed by SODA 2.0
77-
while True:
78-
page = client.get(dataset_id, limit=limit, offset=offset)
79-
if not page:
80-
break # exit the loop if no more results
77+
page = client.get(dataset_id, limit=limit, offset=offset)
78+
while page:
8179
results.extend(page)
8280
offset += limit
83-
81+
page = client.get(dataset_id, limit=limit, offset=offset)
8482
df = pd.DataFrame.from_records(results)
8583
return df
8684

0 commit comments

Comments
 (0)