Skip to content

Commit d6217c7

Browse files
committed
Clarify scraper type annotations
1 parent f36e630 commit d6217c7

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

app/scrapers/sis_scraper.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
import time
44
from enum import Enum
55
from pathlib import Path
6+
from typing import Any
67

78
import aiohttp
89
import bs4
@@ -65,7 +66,7 @@ async def class_search(
6566
max_size: int = 1000,
6667
sort_column: ClassColumn = ClassColumn.SUBJECT_DESCRIPTION,
6768
sort_asc: bool = True,
68-
) -> list[dict]:
69+
) -> list[dict[str, Any]]:
6970
"""
7071
Fetches the list of classes for a given subject and term from SIS.
7172
@@ -196,7 +197,9 @@ async def get_class_crosslists(session: aiohttp.ClientSession, term: str, crn: s
196197

197198

198199
async def process_class_details(
199-
session: aiohttp.ClientSession, course_data: dict, class_entry: dict
200+
session: aiohttp.ClientSession,
201+
course_data: dict[str, Any],
202+
class_entry: dict[str, Any],
200203
) -> None:
201204
"""
202205
Fetches and parses all details for a given class, populating the provided course
@@ -292,7 +295,7 @@ async def get_course_data(
292295
subject: str,
293296
semaphore: asyncio.Semaphore = asyncio.Semaphore(1),
294297
limit_per_host: int = 5,
295-
) -> dict:
298+
) -> dict[str, dict[str, Any]]:
296299
"""
297300
Gets all course data for a given term and subject.
298301
@@ -342,7 +345,7 @@ async def get_term_data(
342345
semaphore: asyncio.Semaphore = asyncio.Semaphore(10),
343346
limit_per_host: int = 5,
344347
output_path: Path | str = None,
345-
) -> dict:
348+
) -> dict[str, dict[str, Any]]:
346349
"""
347350
Gets all course data for a given term, which includes all subjects in the term.
348351

0 commit comments

Comments
 (0)