wbdata
wbdata copied to clipboard
wbdata does not handle indicators with no data
Problem: Some indicators have no data but wbdata loops endlessly, incrementing the requested page on each request.
Example https://api.worldbank.org/v2/sources/85/indicators
Response
<wb:indicators page="1" pages="0" per_page="50" total="0"/>
Solution: early exit if WorldBank API returns pages=0
fetcher.py
def fetch(url, ..):
while pages != this_page:
...
if pages == 0: # early exit if WorldBank API returns pages=0
break
Thanks for the report, I'll get that patched and try not to think about why they have indicators with no data.