fix(fc3a): ruff I001 import-block fixes + use sqlalchemy.case (not func.case)

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-05-20 14:22:53 -04:00
parent ecca91753f
commit bf828c7b9d
4 changed files with 4 additions and 5 deletions
+2 -2
View File
@@ -8,7 +8,7 @@ Dates come from Post.post_date via ImageProvenance.post_id.
from dataclasses import dataclass
from sqlalchemy import and_, func, or_, select
from sqlalchemy import and_, case, func, or_, select
from sqlalchemy.exc import IntegrityError
from sqlalchemy.ext.asyncio import AsyncSession
@@ -228,7 +228,7 @@ class ArtistService:
like = f"%{cleaned.lower()}%"
prefix_like = f"{cleaned.lower()}%"
# Rank: exact (0) < prefix (1) < substring (2).
rank = func.case(
rank = case(
(func.lower(Artist.name) == cleaned.lower(), 0),
(func.lower(Artist.name).like(prefix_like), 1),
else_=2,