Skip to content

: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.

fix(data-imports): stop retrying dataforseo keyword tables without keywords (#109709)

Tom Owersd293c27ec0af
diff --git a/products/warehouse_sources/backend/temporal/data_imports/sources/dataforseo/source.py b/products/warehouse_sources/backend/temporal/data_imports/sources/dataforseo/source.py
index dd5874e145ea..7e9fc1b701d3 100644
--- a/products/warehouse_sources/backend/temporal/data_imports/sources/dataforseo/source.py
+++ b/products/warehouse_sources/backend/temporal/data_imports/sources/dataforseo/source.py
@@ -139,6 +139,8 @@ Note: DataForSEO bills per API request, so syncing these tables consumes account
"DataForSEO API error [40210]": insufficient_funds_message,
"DataForSEO API error [40201]": "Your DataForSEO account is blocked. Contact DataForSEO support to restore access, then resync.",
"DataForSEO API error [40203]": "Your DataForSEO daily spending limit was exceeded. Raise the limit in your DataForSEO account settings or wait for it to reset, then resync.",
+ # Raised by `source_for_pipeline`; the raw message already names the table and the fix.
+ "table is keyword-scoped. Add at least one keyword to the DataForSEO source": None,
}
def get_retryable_errors(self) -> set[str]:
diff --git a/products/warehouse_sources/backend/temporal/data_imports/sources/dataforseo/tests/test_dataforseo_source.py b/products/warehouse_sources/backend/temporal/data_imports/sources/dataforseo/tests/test_dataforseo_source.py
index 32dc0c15ce1e..0df502d98997 100644
--- a/products/warehouse_sources/backend/temporal/data_imports/sources/dataforseo/tests/test_dataforseo_source.py
+++ b/products/warehouse_sources/backend/temporal/data_imports/sources/dataforseo/tests/test_dataforseo_source.py
@@ -208,9 +208,10 @@ class TestDataForSEOSource:
inputs.schema_name = schema_name
inputs.logger = MagicMock()
with patch(f"{MODULE}.dataforseo_source") as source_fn:
- with pytest.raises(ValueError, match="Add at least one keyword"):
+ with pytest.raises(ValueError, match="Add at least one keyword") as exc_info:
DataForSEOSource().source_for_pipeline(_make_config(keywords=" , "), MagicMock(), inputs)
source_fn.assert_not_called()
+ assert error_message_matches(str(exc_info.value), DataForSEOSource().get_non_retryable_errors().keys())
def test_source_for_pipeline_allows_missing_keywords_for_target_tables(self) -> None:
# Only the keyword-scoped tables need keywords; a domain table must still sync without them.