Found while auditing every static data read across the lecture series for QuantEcon/data-lectures#65. Both are live on main today and neither depends on that work — they are ordinary defects in this repo.
Under Pyodide, urllib and requests do not reach the network. pyodide_http.patch_all() is what redirects them through the browser's fetch API, which is why every other data-reading lecture here calls it. These two lectures do not.
1. inequality.md imports the shim and never calls it
Line 96 has import pyodide_http, and patch_all() appears nowhere in the file. The import is doing nothing.
The read that needs it is at line 251, df = pd.read_csv(url), against the SCF extract named at line 250. So the lecture looks shimmed, is not, and the import is exactly the kind of thing a reader would assume is load-bearing.
2. short_path.md has no shim at all
Lines 274-277 do a bare import requests followed by requests.get(file_url) against graph.txt, with no pyodide_http import anywhere in the file.
Fix
Add pyodide_http.patch_all() to inequality.md before the read at line 251, and add both the import and the call to short_path.md before line 277 — matching the pattern already used in long_run_growth.md and french_rev.md.
Worth knowing
inequality.md:250 reads via media.githubusercontent.com from high_dim_data. That is the LFS media endpoint, and the six high_dim_data datasets have since been folded into data-lectures, so this read is also a migration target. It is a separate change from the shim fix and should not be bundled with it — the shim fix is a one-line correction that can land immediately.
If the qeld package proceeds as planned in QuantEcon/data-lectures#65, importing it will install the shim automatically and both call sites lose the boilerplate. That is some way off, and these should be fixed now regardless.
🤖 Generated with Claude Code
Found while auditing every static data read across the lecture series for QuantEcon/data-lectures#65. Both are live on
maintoday and neither depends on that work — they are ordinary defects in this repo.Under Pyodide,
urllibandrequestsdo not reach the network.pyodide_http.patch_all()is what redirects them through the browser's fetch API, which is why every other data-reading lecture here calls it. These two lectures do not.1.
inequality.mdimports the shim and never calls itLine 96 has
import pyodide_http, andpatch_all()appears nowhere in the file. The import is doing nothing.The read that needs it is at line 251,
df = pd.read_csv(url), against the SCF extract named at line 250. So the lecture looks shimmed, is not, and the import is exactly the kind of thing a reader would assume is load-bearing.2.
short_path.mdhas no shim at allLines 274-277 do a bare
import requestsfollowed byrequests.get(file_url)againstgraph.txt, with nopyodide_httpimport anywhere in the file.Fix
Add
pyodide_http.patch_all()toinequality.mdbefore the read at line 251, and add both the import and the call toshort_path.mdbefore line 277 — matching the pattern already used inlong_run_growth.mdandfrench_rev.md.Worth knowing
inequality.md:250reads viamedia.githubusercontent.comfromhigh_dim_data. That is the LFS media endpoint, and the sixhigh_dim_datadatasets have since been folded into data-lectures, so this read is also a migration target. It is a separate change from the shim fix and should not be bundled with it — the shim fix is a one-line correction that can land immediately.If the qeld package proceeds as planned in QuantEcon/data-lectures#65, importing it will install the shim automatically and both call sites lose the boilerplate. That is some way off, and these should be fixed now regardless.
🤖 Generated with Claude Code