Lectures that call the World Bank API fail their build when the API is slow or down
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- Half a day
- Newbie friendliness
- 35/100
Research direction
The World Bank calls sit in lectures/business_cycle.md (after the import wbgapi as wb at line 41), lectures/heavy_tails.md (line 34, with calls near line 803) and lectures/inequality.md (line 94, with calls at lines 553, 572 and 723). Start by reading those cells and the setup the issue proposes for a timeout and retry. Done means the lectures survive a slow or 502 response without failing the build, and the change is reviewed by a maintainer, since it touches lecture content and may wrap wbgapi's private _queryAPI.
Written by the indexing model from the issue text.
Description
Three lectures fetch data from api.worldbank.org through wbgapi while they build: lectures/business_cycle.md (import wbgapi as wb at line 41, then wb.series.info and wb.data.DataFrame for NY.GDP.MKTP.KD.ZG, SL.UEM.TOTL.NE.ZS and FS.AST.PRVT.GD.ZS), lectures/heavy_tails.md (line 34, then wb.data.DataFrame and wb.economy.info near line 803) and lectures/inequality.md (line 94, then SI.POV.GINI at lines 553 and 572 and NY.GDP.PCAP.KD at line 723).
The calls set no timeout and no retry. A 502 from the API fails the cell, and a request that hangs runs to the 600 s cell timeout, so the build fails either way. Both have happened in QuantEcon/actions' lecture matrix: on 2026-11-16 (run 43789867796, see QuantEcon/actions#333) all three lectures failed on APIError: [502] Bad Gateway from api.worldbank.org, and on 2026-11-17 (run 44030094100) the SI.POV.GINI cell in inequality.md timed out after 600 s. A run on 2026-11-12 (43135770816) also failed in business_cycle.md and timed out in inequality.md, but its tracebacks are no longer available.
A possible change: a hidden setup cell after each 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.
lecture-python-programming's pandas.md makes the same kind of call: see QuantEcon/lecture-python-programming#668.
- Dominant language
- Jupyter Notebook
- Stars
- 71
- Forks
- 37
- Avg merge
- 13h 9m
- Merged PRs (30d)
- 8
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from QuantEcon/lecture-python-intro
-
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
QuantEcon/lecture-python-intro#884 ·
Maintainers usually reply within 1 day
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 80/100
QuantEcon/lecture-python-intro#871 ·
Maintainers usually reply within 1 day
-
Difficulty 1/5 Under an hour Newbie friendliness 88/100
QuantEcon/lecture-python-intro#864 ·
Maintainers usually reply within 1 day
-
lake_model_intro, time_series_with_matrices, long_run_growth: four small fixesPossibly taken @nishantmishraa claimed this 29 days ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
QuantEcon/lecture-python-intro#862 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
QuantEcon/lecture-python-intro#851 ·
Maintainers usually reply within 1 day
All issues in QuantEcon/lecture-python-intro
Similar issues
-
stix-atlas.json: the same relationship id is used for several different mitigates relationshipsOpen
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
-
memmapped_arange ignores the start value and drops the last point above the memmap thresholdPossibly taken @prathameshfuke claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
StingraySoftware/HENDRICS#213 ·
-
Lightcurve slicing raises IndexError when the slice bounds are outside the light curvePossibly taken @prathameshfuke claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
StingraySoftware/stingray#1054 ·
Maintainers usually reply within 2 days
-
country:US rating:6 request-theme type:TV SHOW
Difficulty 1/5 Under an hour Newbie friendliness 65/100
LizardByte/ThemerrDB#10501 · 1 comment ·
-
triage/confirmed
Difficulty 2/5 1-3 hours Newbie friendliness 77/100
agentscope-ai/agentscope#4563 ·
Maintainers usually reply within 2 days