Type-check notebooks in CI and fix typing/library usage issues#74
Merged
darthtrevino merged 3 commits intomainfrom May 4, 2026
Merged
Type-check notebooks in CI and fix typing/library usage issues#74darthtrevino merged 3 commits intomainfrom
darthtrevino merged 3 commits intomainfrom
Conversation
Co-authored-by: Copilot <copilot@github.com>
andresmor-ms
approved these changes
May 4, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds notebook type-checking to the CI pipeline and fixes the library-usage and typing issues it surfaced across the example notebooks.
A new
check_notebookspoe task runsnbqa pyrightoverdocs/notebooks/, and is wired into the top-levelchecksequence so notebook regressions are caught alongside the rest of the lint/type-check suite.Changes
pyproject.toml: addnbqa+pyrightnotebook check task and include it in the aggregatechecktask.docs/notebooks/*.ipynb: fix typing and API-usage issues flagged by pyright (imports, argument types, removed/renamed APIs, etc.).benchmark_qed/autoe/utils/stats.py: minor typing fix uncovered while validating notebook usage.uv.lock: refreshed for the added dev tooling.Note on
asyncio.runvs. top-levelawaitSeveral notebook cells previously used top-level
await(which is valid in Jupyter). The verification path we adopted,nbqa pyright, concatenates all cells into a single synthetic.pymodule and runs the pyright CLI over it. In that flattened form, top-levelawaitis reported as a hard parse error ("await" allowed only within async function), and pyright emits no rule name for this diagnostic — so it cannot be silenced via# pyright: ignore[<rule>]or[tool.pyright]settings. (Pyright's notebook-aware mode only exists in the language-server path used by Pylance, not the CLI; nbqa is the standard workaround for CLI-based notebook checking.)To keep the CI check meaningful without resorting to bare
# pyright: ignorecomments scattered throughout, the affected calls have been rewritten to useasyncio.run(...). The notebooks still execute identically end-to-end; only the syntax around the async entry-points changed.Validation
uv run poe check(includescheck_notebooks) passes locally.