fix: ruff findings

This commit is contained in:
soubarna
2026-10-05 17:28:15 +05:30
parent 2c93874799
commit 3355c20202
44 changed files with 117 additions and 213 deletions
+3 -7
View File
@@ -11,7 +11,6 @@ Seams:
- Read side: query_local_day_history() returns entries with evidence flags
- Repair: repair_derivation() does not touch existing local_days
"""
import sqlite3
from datetime import datetime, timedelta, timezone
from pathlib import Path
from typing import Any, Dict
@@ -21,7 +20,7 @@ import sys
sys.path.insert(0, str(Path(__file__).parent.parent / "src"))
from fenris.store import init_store, SCHEMA_VERSION
from fenris.store import init_store
from fenris.local_day import (
derive_local_day_summary,
persist_local_day,
@@ -29,11 +28,9 @@ from fenris.local_day import (
query_local_day_history,
LocalDaySummary,
LocalDayHistoryEntry,
_is_detail_available,
)
from fenris.pruning import prune_old_samples, RAW_SAMPLE_RETENTION_DAYS
from fenris.pruning import prune_old_samples
from fenris.repair import repair_derivation
from fenris.monitoring_periods import ensure_period_open, close_period
# ---------------------------------------------------------------------------
@@ -226,7 +223,7 @@ class TestBoundaryPreservation:
_insert_sample(conn, "2026-09-16T23:55:00+00:00", bw=100)
_insert_sample(conn, "2026-09-17T12:30:00+00:00", bw=200)
pruned = prune_old_samples(conn, now, retention_days=14)
prune_old_samples(conn, now, retention_days=14)
# Boundary anchor should be retained
cursor = conn.execute(
@@ -305,7 +302,6 @@ class TestLegacyDataHandling:
def test_incomplete_legacy_labelled_correctly(self, tmp_path):
"""Legacy summary without full evidence is labelled incomplete."""
conn = init_store(tmp_path / "obs.db")
now = datetime(2026, 10, 1, 12, 0, 0, tzinfo=timezone.utc)
# Simulate a legacy summary that can't establish a full local-day total
legacy = LocalDaySummary(