mirror of
https://github.com/harvard-edge/cs249r_book.git
synced 2026-05-06 17:49:07 -05:00
[PR #1353] [MERGED] fix(labs/lab_05): import plotly.subplots AFTER micropip install #7296
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/harvard-edge/cs249r_book/pull/1353
Author: @profvjreddi
Created: 4/16/2026
Status: ✅ Merged
Merged: 4/16/2026
Merged by: @profvjreddi
Base:
dev← Head:fix/lab05-plotly-import-order📝 Commits (2)
6d56ffffix(labs/lab_05): import plotly.subplots AFTER micropip install1c535fctest(labs): catch runtime-installed imports before micropip.install📊 Changes
2 files changed (+112 additions, -1 deletions)
View changed files
📝
labs/tests/test_static.py(+110 -0)📝
labs/vol2/lab_05_dist_train.py(+2 -1)📄 Description
pre-existing bug caught when loading the dev preview site in a real browser. shown in the attached screenshot — every cell downstream of the setup cell cascades with
ancestor raisedbecause line 55 importsfrom plotly.subplots import make_subplotsBEFORE line 60 installs plotly via micropip.why existing CI missed this
marimo checktest_engine.pytest_static.pymarimo export html-wasmsmoke testonly the user's actual Chrome browser caught this — the console showed
ModuleNotFoundError: No module named 'plotly'cascading across all downstream cells.fix
move the
from plotly.subplots import make_subplotsline to AFTER the micropip install block. plotly is available only at runtime in WASM, so imports must come AFTERawait micropip.install([..., 'plotly', ...]).followup: close the CI gap
should add a playwright step to labs-validate-dev that:
would have caught this before it shipped to dev preview.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.