fix: resolve typecheck errors in cache, atcoder, cses, and usaco

Problem: lua typecheck flagged missing start_time field on ContestSummary;
ty flagged BeautifulSoup Tag/NavigableString union on csrf_input.get(),
a 3-tuple unpack where _extract_problem_info now returns 4 values in
cses.py, and an untyped list assignment in usaco.py.

Solution: add start_time? to ContestSummary LuaDoc, guard csrf_input
with hasattr check and type: ignore, unpack precision from
_extract_problem_info in cses.py callers, and use cast() in usaco.py.
This commit is contained in:
Barrett Ruth 2026-03-03 15:01:59 -05:00 committed by Barrett Ruth
parent bad219e578
commit de5a20c567
4 changed files with 17 additions and 8 deletions

View file

@ -232,10 +232,17 @@ class CSESScraper(BaseScraper):
try:
html = await fetch_text(client, task_path(pid))
tests = parse_tests(html)
timeout_ms, memory_mb, interactive = _extract_problem_info(html)
timeout_ms, memory_mb, interactive, precision = (
_extract_problem_info(html)
)
except Exception:
tests = []
timeout_ms, memory_mb, interactive = 0, 0, False
timeout_ms, memory_mb, interactive, precision = (
0,
0,
False,
None,
)
combined_input = "\n".join(t.input for t in tests) if tests else ""
combined_expected = (
@ -255,6 +262,7 @@ class CSESScraper(BaseScraper):
"memory_mb": memory_mb,
"interactive": interactive,
"multi_test": False,
"precision": precision,
}
tasks = [run_one(p.id) for p in problems]