Skip to content

Drop deprecated_note hasattr pattern in HFCache #2

@electron-rare

Description

@electron-rare

File: apps/api/src/kiki_cockpit/services/hf_cache.py:67-68

if hasattr(card, "deprecated_note"):
    card.deprecated_note = dep.note  # type: ignore[attr-defined]

card is typed as ModelCard but deprecated_note is only on ModelDetail. The HFCache only stores ModelCard objects, so deprecated_note will never be set. The type: ignore masks a real logic gap.

Fix: either add deprecated_note: str | None = None to ModelCard (so listings show the note), or drop the hasattr branch entirely (note only available via detail API).

Metadata

Metadata

Assignees

No one assigned

    Labels

    importantShould fix before next sprintpost-reviewSurfaced by 2026-05-04 cross-sprint review

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions