fix(scrapers): align submit signatures with base class file_path param

Problem: `BaseScraper.submit` was updated to take `file_path` instead of
`source_code`, but cses, codechef, kattis, and usaco still used the old
parameter name, causing basedpyright override errors.

Solution: rename the parameter in all four scrapers. CSES reads the file
content from the path before use. Fix `codechef.fetch_json` missing type
args and `usaco._parse_results_page` narrowing for basedpyright.
This commit is contained in:
Barrett Ruth 2026-03-05 14:25:39 -05:00
parent 2a373b72dd
commit 6c8c32268d
Signed by: barrett
GPG key ID: A6C96C9349D2FC81
4 changed files with 13 additions and 7 deletions

View file

@ -33,7 +33,7 @@ MEMORY_LIMIT_RE = re.compile(
)
async def fetch_json(client: httpx.AsyncClient, path: str) -> dict:
async def fetch_json(client: httpx.AsyncClient, path: str) -> dict[str, Any]:
r = await client.get(BASE_URL + path, headers=HEADERS, timeout=HTTP_TIMEOUT)
r.raise_for_status()
return r.json()
@ -256,7 +256,7 @@ class CodeChefScraper(BaseScraper):
self,
contest_id: str,
problem_id: str,
source_code: str,
file_path: str,
language_id: str,
credentials: dict[str, str],
) -> SubmitResult: