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) <noreply@anthropic.com>
This commit is contained in:
@@ -11,7 +11,6 @@ RBAC:
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
import uuid
|
import uuid
|
||||||
from typing import Optional
|
|
||||||
|
|
||||||
from fastapi import APIRouter, Depends, status
|
from fastapi import APIRouter, Depends, status
|
||||||
from pydantic import BaseModel
|
from pydantic import BaseModel
|
||||||
|
|||||||
@@ -2,7 +2,6 @@
|
|||||||
|
|
||||||
import uuid
|
import uuid
|
||||||
from datetime import datetime
|
from datetime import datetime
|
||||||
from typing import Optional
|
|
||||||
|
|
||||||
from pydantic import BaseModel, ConfigDict
|
from pydantic import BaseModel, ConfigDict
|
||||||
|
|
||||||
|
|||||||
@@ -119,7 +119,6 @@ def _build_device_response(device: Device) -> DeviceResponse:
|
|||||||
|
|
||||||
def _device_with_relations():
|
def _device_with_relations():
|
||||||
"""Return a select() for Device with tags and groups eagerly loaded."""
|
"""Return a select() for Device with tags and groups eagerly loaded."""
|
||||||
from app.models.site import Site # noqa: F811
|
|
||||||
|
|
||||||
return select(Device).options(
|
return select(Device).options(
|
||||||
selectinload(Device.tag_assignments).selectinload(DeviceTagAssignment.tag),
|
selectinload(Device.tag_assignments).selectinload(DeviceTagAssignment.tag),
|
||||||
|
|||||||
@@ -41,7 +41,7 @@ async def get_signal_history(
|
|||||||
bucket_interval, lookback = RANGE_CONFIG.get(range, RANGE_CONFIG["7d"])
|
bucket_interval, lookback = RANGE_CONFIG.get(range, RANGE_CONFIG["7d"])
|
||||||
|
|
||||||
result = await db.execute(
|
result = await db.execute(
|
||||||
text(f"""
|
text("""
|
||||||
SELECT
|
SELECT
|
||||||
time_bucket(:bucket_interval, wr.time) AS bucket,
|
time_bucket(:bucket_interval, wr.time) AS bucket,
|
||||||
avg(wr.signal_strength)::int AS signal_avg,
|
avg(wr.signal_strength)::int AS signal_avg,
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ import uuid
|
|||||||
|
|
||||||
import structlog
|
import structlog
|
||||||
from fastapi import HTTPException, status
|
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 sqlalchemy.ext.asyncio import AsyncSession
|
||||||
|
|
||||||
from app.models.device import Device
|
from app.models.device import Device
|
||||||
|
|||||||
@@ -10,7 +10,6 @@ Uses AdminAsyncSessionLocal (bypasses RLS -- trend detection is system-level).
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
import asyncio
|
import asyncio
|
||||||
from datetime import datetime, timezone
|
|
||||||
|
|
||||||
import structlog
|
import structlog
|
||||||
from sqlalchemy import text
|
from sqlalchemy import text
|
||||||
|
|||||||
Reference in New Issue
Block a user