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(rokt-ads): stop retrying when the account lacks required dimensions or metrics (#91906)

Tom Owers5bf2f569ccb2
diff --git a/products/warehouse_sources/backend/temporal/data_imports/sources/rokt_ads/source.py b/products/warehouse_sources/backend/temporal/data_imports/sources/rokt_ads/source.py
index 993786f250a1..60993077a233 100644
--- a/products/warehouse_sources/backend/temporal/data_imports/sources/rokt_ads/source.py
+++ b/products/warehouse_sources/backend/temporal/data_imports/sources/rokt_ads/source.py
@@ -71,6 +71,19 @@ class RoktAdsSource(ResumableSource[RoktAdsSourceConfig, RoktAdsResumeConfig]):
"advertiser campaigns, if the time zone or currency code setting is unrecognised, or if the account "
"is not fully configured in One Platform. Check your account settings, or contact Rokt support."
),
+ # Raised by build_report_body when the account lacks a dimension that sets the row grain.
+ # Dropping the dimension would silently collapse rows, so the only safe options are to
+ # deselect the table or ask Rokt to enable the dimension — both require user action.
+ "Deselect this table or ask Rokt to enable those dimensions": (
+ "This Rokt account cannot report on one or more dimensions this table needs to identify rows. "
+ "Deselect this table in the sync settings, or contact Rokt to enable the missing dimensions "
+ "for your account, then re-enable the sync."
+ ),
+ # Raised when the account grants none of the metrics the endpoint declares.
+ "Rokt account grants none of the metrics": (
+ "This Rokt account has no metrics enabled for this table. Deselect this table in the sync "
+ "settings, or contact Rokt to enable metrics for your account, then re-enable the sync."
+ ),
}
def get_canonical_descriptions(self) -> CanonicalDescriptions:
diff --git a/products/warehouse_sources/backend/temporal/data_imports/sources/rokt_ads/tests/test_rokt_ads_source.py b/products/warehouse_sources/backend/temporal/data_imports/sources/rokt_ads/tests/test_rokt_ads_source.py
index 9cbd0dce6e8b..81d2a6486630 100644
--- a/products/warehouse_sources/backend/temporal/data_imports/sources/rokt_ads/tests/test_rokt_ads_source.py
+++ b/products/warehouse_sources/backend/temporal/data_imports/sources/rokt_ads/tests/test_rokt_ads_source.py
@@ -199,6 +199,11 @@ class TestNonRetryableErrors:
assert any("403" in key for key in errors)
assert any("400" in key for key in errors)
+ def test_account_capability_errors_stop_retrying(self):
+ errors = RoktAdsSource().get_non_retryable_errors()
+ assert "Deselect this table or ask Rokt to enable those dimensions" in errors
+ assert "Rokt account grants none of the metrics" in errors
+
class TestCanonicalDescriptions:
def test_every_table_is_documented(self):