Skip to content

wbdata does not handle indicators with no data #76

Description

@EdGaere

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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions