: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(warehouse-sources): give gladly operators an actionable report error (#86128)
posthog[bot]de10c5480d8f
diff --git a/products/warehouse_sources/backend/temporal/data_imports/sources/gladly/source.py b/products/warehouse_sources/backend/temporal/data_imports/sources/gladly/source.pyindex 4458b043113b..9d2c9316bcb2 100644--- a/products/warehouse_sources/backend/temporal/data_imports/sources/gladly/source.py+++ b/products/warehouse_sources/backend/temporal/data_imports/sources/gladly/source.py@@ -67,12 +67,16 @@ class GladlySource(ResumableSource[GladlySourceConfig, GladlyResumeConfig]):return {"401 Client Error: Unauthorized for url": "Gladly authentication failed. Please check your agent email and API token.","403 Client Error: Forbidden for url": "Gladly denied access. Please check that the agent has the API User permission.",- # Raised by `_report_rows` when a report header is missing the columns the stream is- # keyed on. Gladly returns the same body for that window on a retry, so stop and tell- # the customer rather than replaying it.+ # Raised by `_report_rows` when a report body is missing the columns the stream is+ # keyed on: usually Gladly returned an error in place of the CSV, but a renamed keyed+ # column trips it too. The same window returns the same body on a retry, so neither the+ # sync nor the incremental-field picker can fix it. The copy names Gladly first and+ # PostHog support as the fallback for the renamed-column case, where the report exists."Gladly report is missing required columns": (- "Gladly returned a report without the columns this table syncs on, so there was no "- "data to sync. Re-enable the sync to try again, and contact support if it keeps happening."+ "Gladly returned data that doesn't match the report this table needs, so there was "+ "no data to sync. This usually means Gladly could not build the report for your "+ "account. Ask Gladly support to check the report is available for your account. If "+ "Gladly confirms it is, contact PostHog support."),}diff --git a/products/warehouse_sources/backend/temporal/data_imports/sources/gladly/tests/test_gladly_source.py b/products/warehouse_sources/backend/temporal/data_imports/sources/gladly/tests/test_gladly_source.pyindex 3b6e1155160c..8cea1fcc706a 100644--- a/products/warehouse_sources/backend/temporal/data_imports/sources/gladly/tests/test_gladly_source.py+++ b/products/warehouse_sources/backend/temporal/data_imports/sources/gladly/tests/test_gladly_source.py@@ -30,6 +30,16 @@ class TestGladlySource:non_retryable_errors = self.source.get_non_retryable_errors()assert any(key in observed_error for key in non_retryable_errors)+ def test_missing_report_columns_copy_points_at_gladly_not_a_retry(self):+ # A report keyed column that Gladly never returns is deterministic per window, so the copy+ # must not send the operator back to re-enable the sync or to the incremental-field picker.+ message = self.source.get_non_retryable_errors()["Gladly report is missing required columns"]+ assert message is not None+ lowered = message.lower()+ assert "re-enable" not in lowered+ assert "incremental" not in lowered+ assert "gladly support" in lowered+def test_non_retryable_errors_does_not_match_server_errors(self):non_retryable_errors = self.source.get_non_retryable_errors()error = "500 Server Error for url: https://myorg.gladly.com/api/v1/export/jobs"