: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(fillout): avoid Unix-epoch afterDate on first incremental sync (#74637)
Tom Owersf2af164806f5
diff --git a/products/warehouse_sources/backend/temporal/data_imports/sources/fillout/fillout.py b/products/warehouse_sources/backend/temporal/data_imports/sources/fillout/fillout.pyindex fd718f0c1298..42afbc2b9198 100644--- a/products/warehouse_sources/backend/temporal/data_imports/sources/fillout/fillout.py+++ b/products/warehouse_sources/backend/temporal/data_imports/sources/fillout/fillout.py@@ -66,7 +66,9 @@ def _fillout_incremental_window(cursor_path: str) -> IncrementalConfig:return {"cursor_path": cursor_path,"start_param": "afterDate",- "initial_value": "1970-01-01T00:00:00Z",+ # Not `...T00:00:00Z`: Fillout's API rejects an `afterDate` of exactly the Unix epoch+ # with a 400 "Invalid date", so the first (pre-watermark) sync uses one second past it.+ "initial_value": "1970-01-01T00:00:01Z","convert": _format_fillout_datetime,}diff --git a/products/warehouse_sources/backend/temporal/data_imports/sources/fillout/tests/test_fillout.py b/products/warehouse_sources/backend/temporal/data_imports/sources/fillout/tests/test_fillout.pyindex dc792dabaa6f..9f72bcd8dc93 100644--- a/products/warehouse_sources/backend/temporal/data_imports/sources/fillout/tests/test_fillout.py+++ b/products/warehouse_sources/backend/temporal/data_imports/sources/fillout/tests/test_fillout.py@@ -9,6 +9,7 @@ from parameterized import parameterizedfrom products.warehouse_sources.backend.temporal.data_imports.sources.fillout.fillout import (FilloutSubmissionsPaginator,+ _fillout_incremental_window,_format_fillout_datetime,_validated_api_base_url,fillout_source,@@ -92,6 +93,12 @@ class TestFilloutTransport:def test_format_fillout_datetime(self, _name, value, expected) -> None:assert _format_fillout_datetime(value) == expected+ def test_fillout_incremental_window_initial_value_is_not_unix_epoch(self) -> None:+ # Fillout's API 400s on an `afterDate` of exactly 1970-01-01T00:00:00Z (any+ # millisecond precision), so the pre-watermark sentinel must land elsewhere.+ config = _fillout_incremental_window("submissionTime")+ assert config["initial_value"] not in ("1970-01-01T00:00:00Z", "1970-01-01T00:00:00.000Z")+def test_validated_api_base_url_rejects_unknown(self) -> None:with pytest.raises(ValueError,