: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-imports): keep transient object-store blips out of error tracking on delta corruption check (#75846)
Tom Owerscc984565a43d
diff --git a/products/warehouse_sources/backend/temporal/data_imports/pipelines/common/extract.py b/products/warehouse_sources/backend/temporal/data_imports/pipelines/common/extract.pyindex 22274f60e4a7..7b3a07b2e2c7 100644--- a/products/warehouse_sources/backend/temporal/data_imports/pipelines/common/extract.py+++ b/products/warehouse_sources/backend/temporal/data_imports/pipelines/common/extract.py@@ -428,6 +428,17 @@ async def handle_corrupted_delta_log(if not await delta_table_helper.is_table_corrupted():return Falseexcept Exception as e:+ if is_transient_object_store_error(e):+ # `is_table_corrupted` opens the table via `DeltaTable.is_deltatable`, which can hit+ # the same IMDS/STS credential-provider or connectivity blips as any other delta-rs+ # object-store call — not evidence the table is corrupt, just a blip talking to our+ # own S3 bucket. Skip the revive check this sync rather than reporting a defect; the+ # next sync's check runs fresh.+ await logger.awarning(+ f"handle_corrupted_delta_log: is_table_corrupted transient object-store error, "+ f"skipping revive check schema_id={schema.id}: {e}"+ )+ return Falsecapture_exception(e)return Falsediff --git a/products/warehouse_sources/backend/temporal/data_imports/pipelines/common/test/test_extract.py b/products/warehouse_sources/backend/temporal/data_imports/pipelines/common/test/test_extract.pyindex ed7ef506270a..c23f61401707 100644--- a/products/warehouse_sources/backend/temporal/data_imports/pipelines/common/test/test_extract.py+++ b/products/warehouse_sources/backend/temporal/data_imports/pipelines/common/test/test_extract.py@@ -422,6 +422,32 @@ class TestHandleCorruptedDeltaLog:job.refresh_from_db()assert job.billable is True+ def test_is_table_corrupted_transient_object_store_error_skips_without_capturing(self, team):+ # `is_table_corrupted` opens the table via `DeltaTable.is_deltatable`, which can raise the+ # same IMDS/STS credential-provider blip as any other delta-rs object-store call. That isn't+ # evidence of corruption — it must be treated like the reset-path blip above (skip, log a+ # warning, no error-tracking capture) rather than unconditionally reported as a defect.+ schema, job = self._schema_and_job(team)+ corrupt_check_error = OSError(+ "Operation not supported: an error occurred while loading credentials: dispatch failure: "+ "timeout: client error (Connect): HTTP connect timeout occurred after 3.1s: timed out"+ )+ helper = MagicMock(is_table_corrupted=AsyncMock(side_effect=corrupt_check_error), reset_table=AsyncMock())+ logger = self._logger()++ with (+ patch(f"{_EXTRACT_MODULE}.posthoganalytics"),+ patch(f"{_EXTRACT_MODULE}.capture_exception") as mock_capture,+ ):+ result = async_to_sync(handle_corrupted_delta_log)(schema, job, helper, logger)++ assert result is False+ mock_capture.assert_not_called()+ helper.reset_table.assert_not_awaited()+ logger.awarning.assert_awaited()+ job.refresh_from_db()+ assert job.billable is True+def test_revive_marker_resets_readable_table(self, team):# A hollow table — log opens fine but references data files gone from S3 — is invisible to# is_table_corrupted; the repartition scan marks it instead. The marker alone must trigger the