From f247f9247cc77b3b57598a5badffdfbfad389fc1 Mon Sep 17 00:00:00 2001 From: Bryan Van Deusen Date: Mon, 29 Jun 2026 11:34:40 -0400 Subject: [PATCH] =?UTF-8?q?style(gpu):=20ruff=20=E2=80=94=20split=20as-imp?= =?UTF-8?q?ort,=20dict(rows)=20over=20comprehension?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Claude Opus 4.8 Claude-Session: https://claude.ai/code/session_01Ttrj5P7upUTueSfoJcxEqa --- backend/app/api/gpu.py | 2 +- backend/app/tasks/ml.py | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/backend/app/api/gpu.py b/backend/app/api/gpu.py index 6eb4d39..0a9b46a 100644 --- a/backend/app/api/gpu.py +++ b/backend/app/api/gpu.py @@ -76,7 +76,7 @@ async def status(): select(GpuJob.status, func.count()).group_by(GpuJob.status) ) ).all() - counts = {s: c for s, c in rows} + counts = dict(rows) return jsonify({ "pending": counts.get("pending", 0), "leased": counts.get("leased", 0), diff --git a/backend/app/tasks/ml.py b/backend/app/tasks/ml.py index 72c2f80..708aa22 100644 --- a/backend/app/tasks/ml.py +++ b/backend/app/tasks/ml.py @@ -745,7 +745,8 @@ def enqueue_gpu_backfill(task_name: str) -> int: """Enqueue a gpu_job for every image that doesn't already have one for `task_name` (one INSERT…SELECT, so it scales to a full library). The desktop agent drains the queue over HTTP. Returns the number enqueued.""" - from sqlalchemy import exists, insert, literal, select as sa_select + from sqlalchemy import exists, insert, literal + from sqlalchemy import select as sa_select from ..models import GpuJob, ImageRecord