Source: pyright.txt (1562 errors, 36 warnings)
Date: 2026-06-08
DONE ### Cluster A: str ↔ List[str] (~30 errors)
Variable typed as List[str] assigned str, or vice versa. Pure copy-paste / naming collision.
Fix: One annotation swap per file. One minute each.
| Hotspot Files | Line Count |
|---|---|
config_root/config/config_.py |
323, 341, 380 |
dev_scripts_helpers/preprocess_notes.py |
557, 560 |
dev_scripts_helpers/lib_tasks_docker.py |
1272-1317 (8 errors) |
helpers/hpandas_display.py |
47-57 |
helpers/hpandas_analysis.py |
442, 467 |
Function declared -> str returns str | None, or str | None argument passed where str expected. Three sub-patterns:
- Missing return path → add
Optional[str]to return type - Caller passes None → add
assert x is not Noneor fix call - Hardcoded
Nonepassed tostrparam → fix call site
Hotspots: hparquet.py, hprint.py, hs3.py, hpandas_utils.py, hpytest.py, hunit_test.py, repo_config_utils.py, hversion.py, many test_*.py files.
DONE ### Cluster C: Literal['echo'] vs int (2 errors)
dev_scripts_helpers/git/gup.py:53,65 — string log level passed where int expected.
Fix: Change 'echo' to the numeric log level constant.
DONE ### Cluster D (~120 errors across 40 files)
Pattern: Variable assigned inside conditional branches, one branch skips it, then used after the block.
Fix: Initialize before the conditional, then assert not None.
Hotspots (10+ errors each):
helpers/hgoogle_drive_api.py—goasea,godisc,gspreadlazy importshelpers/hunit_test.py—pd,np,pltlazy importshelpers/hdatetime.py—pytzlazy importhelpers/henv.py—psutillazy import
Quick sub-fix for lazy imports (~40 errors): # type: ignore[possibly-unbound] on the import line.
Pandas returns Timestamp | NaTType, code expects Timestamp.
Hotspot files (30+ errors each): test_hdatetime.py, test_hparquet.py, test_hpandas_transform.py.
Pandas groupby/apply/window ops return unions.
Passing lists to .loc[..., columns=] / .drop(labels=).
Pandas stubs don't expose these on the abstract Index base class — they exist at runtime on DatetimeIndex/MultiIndex.
Recommended approach: Add project-wide pyright exclusions for pandas stubs rather than 310 individual # type: ignore comments.
Custom trace() log level added at runtime, not in typeshed. Concentrated in hcache_simple.py (50+ errors).
Functions (shutup_chatty_modules, test_logger, set_v2_formatter, etc.) moved/renamed.
Fix: Bulk # type: ignore[attr-defined] or add a project-wide exclusion.
s3fs type stubs don't match actual runtime API. Methods like open(), ls(), glob(), exists(), put(), get(), rm() are all reported as unknown.
Best fix: Project-wide reportAttributeAccessIssue = false for s3fs module — more efficient than 35 individual # type: ignore.
omegaconf, ml_collections, pyannotate_runtime, junitparser, dill, pypdf, pygame, pysftp, psycopg2, asana, git_filter_repo, helpers.user_credentials.
Fix: Most are optional/script-specific deps. One # type: ignore[import] per file.
github.Repository, boto3.session, hydra.core, IPython.display, pyarrow.lib.
Fix: Different import path or # type: ignore.
hjoblib.py (4 overrides of StoreBackendBase), test_hobject.py (parameterized test base class), htqdm.py, hsql_test.py, docs_mkdocs/check_mkdocs_links.py.
Fix: Adjust signatures to match parent class. Requires understanding the override contract.
from invoke import task → from invoke.tasks import task
MockContext / Result → new homes per invoke version.
hchatgpt.py, hllm.py, hllm_cost.py. SDK stubs don't match usage.
Fix: Per-method investigation + stub updates or type: ignore.
| Priority | Errors | Time | Risk |
|---|---|---|---|
| Phases 1-2 (A-D) | ~260 | 4-6 hr | Mechanical, low risk |
| Phase 3 (E-H) | ~310 | 3-5 hr | Better solved with project-wide pandas exclusion |
| Phase 4 (I-J) | ~80 | 1 hr | Mechanical, low risk |
| Phase 5 (K) | ~35 | 1 hr | Better solved with project-wide s3fs exclusion |
| Phase 6 (L-M) | ~45 | 2-4 hr | Mixed, some investigation needed |
| Phase 7 (N-P) | ~50 | 3-5 hr | Needs code understanding |
| Total | ~780 non-warning errors | ~15-25 hr |
Quick win: Phases 1-4 cover ~650 errors (80% of total) with mechanical one-line fixes in ~10 hours.
Alternative strategy: Add project-wide pyright exclusions for pandas and s3fs, which eliminates ~350 errors (Clusters E/F/G/H/K) with zero code changes. Then fix the remaining ~430 errors mechanically.