From 22c50d317689db39f9c0986b8de3b7fbfdfa5d80 Mon Sep 17 00:00:00 2001 From: Matt Johnson Date: Sat, 16 May 2026 20:03:34 +0000 Subject: [PATCH] fix(firms): use public is_published/mark_published methods Match NWS adapter pattern for supervisor compatibility. Co-Authored-By: Claude Opus 4.5 --- src/central/adapters/firms.py | 8 ++++---- tests/test_firms.py | 6 +++--- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/central/adapters/firms.py b/src/central/adapters/firms.py index de3603c..48b5415 100644 --- a/src/central/adapters/firms.py +++ b/src/central/adapters/firms.py @@ -175,7 +175,7 @@ class FIRMSAdapter(SourceAdapter): self._db = None logger.info("FIRMS adapter shut down") - def _is_published(self, stable_id: str) -> bool: + def is_published(self, stable_id: str) -> bool: """Check if an event has already been published.""" if not self._db: return False @@ -185,7 +185,7 @@ class FIRMSAdapter(SourceAdapter): ) return cur.fetchone() is not None - def _mark_published(self, stable_id: str) -> None: + def mark_published(self, stable_id: str) -> None: """Mark an event as published.""" if not self._db: return @@ -383,12 +383,12 @@ class FIRMSAdapter(SourceAdapter): row["longitude"], ) - if self._is_published(stable_id): + if self.is_published(stable_id): continue event = self._row_to_event(row, satellite) yield event - self._mark_published(stable_id) + self.mark_published(stable_id) new_count += 1 total_new += new_count diff --git a/tests/test_firms.py b/tests/test_firms.py index fb42251..8e569ad 100644 --- a/tests/test_firms.py +++ b/tests/test_firms.py @@ -246,13 +246,13 @@ class TestDeduplication: stable_id = "VIIRS_SNPP_NRT:2026-05-16:1430:45.123:-116.456" # Not published initially - assert not adapter._is_published(stable_id) + assert not adapter.is_published(stable_id) # Mark as published - adapter._mark_published(stable_id) + adapter.mark_published(stable_id) # Now should be published - assert adapter._is_published(stable_id) + assert adapter.is_published(stable_id) await adapter.shutdown()