: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-warehouse): drop api field names from the incremental sync error (#107492)
Tom Owers2d0d1d56dd22
diff --git a/products/warehouse_sources/backend/presentation/views/external_data_schema.py b/products/warehouse_sources/backend/presentation/views/external_data_schema.pyindex b29a9faa4ae8..e27883705aba 100644--- a/products/warehouse_sources/backend/presentation/views/external_data_schema.py+++ b/products/warehouse_sources/backend/presentation/views/external_data_schema.py@@ -316,7 +316,7 @@ def _apply_primary_key_columns(elif not payload.get("primary_key_columns"):raise ValidationError(f"{label} requires a primary key on table '{instance.name}'. "- "Provide primary_key_columns or refresh schema discovery to pick one up."+ "Choose a primary key for it, or add one on the source table and resync.")@@ -997,7 +997,7 @@ class ExternalDataSchemaSerializer(UserAccessControlSerializerMixin, serializersif source_detects_keys and known_columns and not merge_keys and "id" not in column_names:raise ValidationError(f"'{instance.name}' has no primary key to sync incrementally on. "- "Set primary_key_columns for it, or choose full_refresh."+ "Choose a primary key for it, or switch it to full table replication.")# Only the names this request supplies. A key stored against older metadata must not# block an edit that leaves it alone.diff --git a/products/warehouse_sources/backend/presentation/views/external_data_source/source_setup.py b/products/warehouse_sources/backend/presentation/views/external_data_source/source_setup.pyindex 86ca40dfc3e9..b00062c254ce 100644--- a/products/warehouse_sources/backend/presentation/views/external_data_source/source_setup.py+++ b/products/warehouse_sources/backend/presentation/views/external_data_source/source_setup.py@@ -1474,7 +1474,7 @@ class ExternalDataSourceSetupMixin(base.ExternalDataSourceViewSetBase):return Response(data={"message": f"Table '{schema_name}' has no primary key to sync incrementally on. "- "Set primary_key_columns for it, or choose full_refresh."+ "Choose a primary key for it, or switch it to full table replication."},status=status.HTTP_400_BAD_REQUEST,)diff --git a/products/warehouse_sources/backend/tests/api/test_external_data_source.py b/products/warehouse_sources/backend/tests/api/test_external_data_source.pyindex 6a9e001b5135..2a78878c5d3d 100644--- a/products/warehouse_sources/backend/tests/api/test_external_data_source.py+++ b/products/warehouse_sources/backend/tests/api/test_external_data_source.py@@ -4958,7 +4958,13 @@ class TestExternalDataSource(APIBaseTest):)assert response.status_code == status.HTTP_400_BAD_REQUEST, response.content- assert "no primary key" in response.json()["message"].lower()+ message = response.json()["message"]+ assert "no primary key" in message.lower()+ # The wizard shows this verbatim, so it has to name the sync method the form offers+ # rather than the API field and enum value behind it.+ assert "full table replication" in message+ assert "primary_key_columns" not in message+ assert "full_refresh" not in messageassert ExternalDataSource.objects.filter(team_id=self.team.pk).count() == 0@parameterized.expand(