From 9d6b68760fb2869aa25474824d5834c9440cd2f8 Mon Sep 17 00:00:00 2001 From: Jason Staack Date: Thu, 19 Mar 2026 13:45:47 -0500 Subject: [PATCH] fix(lint): remove unused imports and extraneous f-string prefix Ruff auto-fix: unused Optional imports in sectors router and link schemas, unused Site import in device service, unused datetime imports in trend detector, unused text import in site service, and f-string without placeholders in signal history service. Co-Authored-By: Claude Opus 4.6 (1M context) --- backend/app/routers/sectors.py | 1 - backend/app/schemas/link.py | 1 - backend/app/services/device.py | 1 - backend/app/services/signal_history_service.py | 2 +- backend/app/services/site_service.py | 2 +- backend/app/services/trend_detector.py | 1 - 6 files changed, 2 insertions(+), 6 deletions(-) diff --git a/backend/app/routers/sectors.py b/backend/app/routers/sectors.py index 940d83e..05fa323 100644 --- a/backend/app/routers/sectors.py +++ b/backend/app/routers/sectors.py @@ -11,7 +11,6 @@ RBAC: """ import uuid -from typing import Optional from fastapi import APIRouter, Depends, status from pydantic import BaseModel diff --git a/backend/app/schemas/link.py b/backend/app/schemas/link.py index 6e8b067..851a9b5 100644 --- a/backend/app/schemas/link.py +++ b/backend/app/schemas/link.py @@ -2,7 +2,6 @@ import uuid from datetime import datetime -from typing import Optional from pydantic import BaseModel, ConfigDict diff --git a/backend/app/services/device.py b/backend/app/services/device.py index 6eb9675..76dea39 100644 --- a/backend/app/services/device.py +++ b/backend/app/services/device.py @@ -119,7 +119,6 @@ def _build_device_response(device: Device) -> DeviceResponse: def _device_with_relations(): """Return a select() for Device with tags and groups eagerly loaded.""" - from app.models.site import Site # noqa: F811 return select(Device).options( selectinload(Device.tag_assignments).selectinload(DeviceTagAssignment.tag), diff --git a/backend/app/services/signal_history_service.py b/backend/app/services/signal_history_service.py index acd2135..79053a8 100644 --- a/backend/app/services/signal_history_service.py +++ b/backend/app/services/signal_history_service.py @@ -41,7 +41,7 @@ async def get_signal_history( bucket_interval, lookback = RANGE_CONFIG.get(range, RANGE_CONFIG["7d"]) result = await db.execute( - text(f""" + text(""" SELECT time_bucket(:bucket_interval, wr.time) AS bucket, avg(wr.signal_strength)::int AS signal_avg, diff --git a/backend/app/services/site_service.py b/backend/app/services/site_service.py index 72e7419..81ce462 100644 --- a/backend/app/services/site_service.py +++ b/backend/app/services/site_service.py @@ -8,7 +8,7 @@ import uuid import structlog from fastapi import HTTPException, status -from sqlalchemy import func, select, text, update +from sqlalchemy import func, select, update from sqlalchemy.ext.asyncio import AsyncSession from app.models.device import Device diff --git a/backend/app/services/trend_detector.py b/backend/app/services/trend_detector.py index a2e8092..98a4e68 100644 --- a/backend/app/services/trend_detector.py +++ b/backend/app/services/trend_detector.py @@ -10,7 +10,6 @@ Uses AdminAsyncSessionLocal (bypasses RLS -- trend detection is system-level). """ import asyncio -from datetime import datetime, timezone import structlog from sqlalchemy import text