You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Lectures that call the World Bank API fail their build when the API is slow or down #668
lectures/pandas.md fetches data from api.worldbank.org through wbgapi while it builds: import wbgapi as wb at line 615, then wb.series.info('GC.DOD.TOTL.GD.ZS') and wb.data.DataFrame('GC.DOD.TOTL.GD.ZS', …) at lines 616 and 620.
The calls set no timeout and no retry, so a 502 from the API fails the cell, and a request that hangs runs to the 600 s cell timeout. That is how lecture-python-intro's World Bank lectures failed in QuantEcon/actions' lecture matrix on 2026-11-16 and 2026-11-17 (see QuantEcon/actions#333 and QuantEcon/lecture-python-intro#877). This repository's jobs passed in those runs, but pandas.md has the same exposure.
A possible change: a hidden setup cell after import wbgapi as wb that sets a request timeout (wbgapi 1.0.14 passes wb.get_options to requests.get, so wb.get_options['timeout'] = 60 works) and retries a failed request up to three times. A timeout alone would turn slow successes into failures, so the retry matters. wbgapi has no public retry option: a retry means wrapping its private _queryAPI, or a change in wbgapi itself. Any such change touches lecture content, so it needs a person's review before it merges.
pandas.md teaches fetching data from a web API (its section "Using wbgapi and yfinance to Access Data"), so the live call stays. This stays open while the approach is decided: for example, re-running a lecture when a build fails on a network error, rather than changing lecture code for intermittent outages. The intro lectures are sorted out in QuantEcon/lecture-python-intro#877.
Activity
mmcky commentedon Nov 22, 2026
pandas.mdteaches fetching data from a web API (its section "Using wbgapi and yfinance to Access Data"), so the live call stays. This stays open while the approach is decided: for example, re-running a lecture when a build fails on a network error, rather than changing lecture code for intermittent outages. The intro lectures are sorted out in QuantEcon/lecture-python-intro#877.