|
20 | 20 | from api.cache import cache_key, get_or_set_cache |
21 | 21 | from api.dependencies import require_db |
22 | 22 | from core.constants import SUPPORTED_LIBRARIES |
23 | | -from core.database import ImplRepository, SpecRepository |
| 23 | +from core.database import ImplRepository, Spec, SpecRepository |
24 | 24 | from core.database.connection import get_db_context |
25 | 25 | from core.utils import strip_noqa_comments |
26 | 26 |
|
@@ -219,7 +219,7 @@ async def _build_dashboard(repo: SpecRepository, impl_repo: ImplRepository) -> D |
219 | 219 | all_scores: list[float] = [] |
220 | 220 |
|
221 | 221 | library_scores: dict[str, list[float]] = {lib: [] for lib in SUPPORTED_LIBRARIES} |
222 | | - library_counts: dict[str, int] = dict.fromkeys(SUPPORTED_LIBRARIES, 0) # type: ignore[arg-type] |
| 222 | + library_counts = dict.fromkeys(SUPPORTED_LIBRARIES, 0) |
223 | 223 |
|
224 | 224 | tag_counter: dict[str, Counter[str]] = defaultdict(Counter) |
225 | 225 | monthly_counts: Counter[str] = Counter() |
@@ -368,7 +368,7 @@ async def _build_potd(spec_repo: SpecRepository, impl_repo: ImplRepository) -> P |
368 | 368 | today = date.today().isoformat() |
369 | 369 |
|
370 | 370 | # Collect candidates: implementations with quality_score >= 90 (lightweight, no code loaded) |
371 | | - candidates: list[tuple[str, str, str, str | None, float, str | None]] = [] |
| 371 | + candidates: list[tuple[str, str, str, str, float, str]] = [] |
372 | 372 | for spec in all_specs: |
373 | 373 | for impl in spec.impls: |
374 | 374 | if impl.quality_score is not None and impl.quality_score >= 90 and impl.preview_url: |
@@ -428,7 +428,7 @@ async def _fetch() -> PlotOfTheDayResponse | None: |
428 | 428 | # ============================================================================= |
429 | 429 |
|
430 | 430 |
|
431 | | -def _collect_impl_tags(spec: object, library: str | None = None) -> set[str]: |
| 431 | +def _collect_impl_tags(spec: Spec, library: str | None = None) -> set[str]: |
432 | 432 | """Collect spec-level tags + impl-level tags for a spec. |
433 | 433 |
|
434 | 434 | If library is specified, only include that library's impl_tags. |
@@ -471,7 +471,7 @@ async def _build_related( |
471 | 471 | return RelatedSpecsResponse(related=[]) |
472 | 472 |
|
473 | 473 | # Compute similarity for all other specs |
474 | | - scored: list[tuple[float, list[str], object]] = [] |
| 474 | + scored: list[tuple[float, list[str], Spec]] = [] |
475 | 475 | for spec in all_specs: |
476 | 476 | if spec.id == spec_id: |
477 | 477 | continue |
|
0 commit comments