:hedgehog: PostHog is the leading platform for building self-driving products. Our developer tools – AI observability, analytics, session replay, flags, experiments, error tracking, logs, and more – capture all the context agents need to diagnose problems, uncover opportunities, and ship fixes. Steer it all from Slack, web, desktop, or the MCP.
Python ab-testingai-analyticsanalyticscdpdata-warehouseexperimentsfeature-flagsjavascriptproduct-analyticspythonreactsession-replaysurveystypescriptweb-analytics
fix(data-warehouse): deprioritize paused source schemas (#76058)
Eric Duong4b6dda97721d
diff --git a/frontend/src/scenes/data-warehouse/scene/warehouseStatusDisplay.tsx b/frontend/src/scenes/data-warehouse/scene/warehouseStatusDisplay.tsxindex 134bf2ff9625..a8ec5a5beee3 100644--- a/frontend/src/scenes/data-warehouse/scene/warehouseStatusDisplay.tsx+++ b/frontend/src/scenes/data-warehouse/scene/warehouseStatusDisplay.tsx@@ -33,8 +33,8 @@ export const STATUS_SEVERITY: Record<ManagedWarehouseReadinessStateEnumApi, numbneeds_attention: 0,backfilling: 1,waiting: 2,- sync_paused: 3,- up_to_date: 4,+ up_to_date: 3,+ sync_paused: 4,not_configured: 5,}diff --git a/products/data_warehouse/backend/logic/managed_warehouse_data_status.py b/products/data_warehouse/backend/logic/managed_warehouse_data_status.pyindex 6d248aea4573..ef59e7c0a841 100644--- a/products/data_warehouse/backend/logic/managed_warehouse_data_status.py+++ b/products/data_warehouse/backend/logic/managed_warehouse_data_status.py@@ -22,15 +22,14 @@ ReadinessState = Literal[]PERSISTENT_BACKFILL_FAILURES = 3-# sync_paused ranks below every active-work or failure state (those are still worth surfacing even-# on a paused schema's source) but above up_to_date: a source with some schemas paused shouldn't-# read as fully "up to date" when part of it isn't being kept current at all.+# A paused schema is intentional configuration, so active and healthy schemas determine a source's+# rollup first. A source still reports sync_paused when every visible schema is paused.READINESS_PRIORITY: tuple[ReadinessState, ...] = ("needs_attention","backfilling","waiting",- "sync_paused","up_to_date",+ "sync_paused",)diff --git a/products/data_warehouse/backend/tests/test_managed_warehouse_data_status.py b/products/data_warehouse/backend/tests/test_managed_warehouse_data_status.pyindex 0952ab0713e2..ab3391fc01d7 100644--- a/products/data_warehouse/backend/tests/test_managed_warehouse_data_status.py+++ b/products/data_warehouse/backend/tests/test_managed_warehouse_data_status.py@@ -317,13 +317,19 @@ class TestRollupSources(SimpleTestCase):assert summary["last_synced_at"] == newerassert summary["last_applied_at"] == newer- def test_a_paused_schema_outranks_up_to_date_but_not_a_real_problem(self) -> None:- # A source where some schemas aren't being kept current at all shouldn't read as fully- # healthy, but an active problem elsewhere in the same source still has to win.+ def test_a_paused_schema_is_deprioritized_below_healthy_active_schemas(self) -> None:+ # Users often sync only a subset of a source, so an intentional pause should not mask the+ # health of schemas that are actively syncing. A source with only paused schemas stays paused.source_id = str(uuid4())+ paused = _table(+ source_id=source_id,+ source_name="Stripe",+ table_name="invoices",+ readiness_state="sync_paused",+ )mostly_healthy = [_table(source_id=source_id, source_name="Stripe", table_name="charges", readiness_state="up_to_date"),- _table(source_id=source_id, source_name="Stripe", table_name="invoices", readiness_state="sync_paused"),+ paused,]with_a_real_problem = [*mostly_healthy,@@ -331,9 +337,11 @@ class TestRollupSources(SimpleTestCase):][healthy_summary] = _rollup_sources(mostly_healthy)+ [paused_summary] = _rollup_sources([paused])[problem_summary] = _rollup_sources(with_a_real_problem)- assert healthy_summary["readiness_state"] == "sync_paused"+ assert healthy_summary["readiness_state"] == "up_to_date"+ assert paused_summary["readiness_state"] == "sync_paused"assert problem_summary["readiness_state"] == "needs_attention"def test_a_paused_schema_still_counts_toward_backfilled(self) -> None: