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.

feat(data-catalog): propose deprecating a table or view (#76734)

Thiago Salvatorec7eca2747bb7
diff --git a/posthog/hogql/database/schema/information_schema.py b/posthog/hogql/database/schema/information_schema.py
index 6e60c4d49783..e1e3296c5fd9 100644
--- a/posthog/hogql/database/schema/information_schema.py
+++ b/posthog/hogql/database/schema/information_schema.py
@@ -860,6 +860,7 @@ _CERTIFICATIONS_COLUMNS: list[tuple[str, str]] = [
("target_id", _STRING),
("target_kind", _STRING),
("status", _STRING),
+ ("proposed_status", _STRING),
("notes", _NULLABLE_STRING),
("certified_by", _NULLABLE_STRING),
("certified_at", _NULLABLE_STRING),
@@ -869,7 +870,8 @@ _CERTIFICATIONS_DESCRIPTION = (
"Catalog of trust-mark proposals and decisions on warehouse tables and views; one row per "
"certification. Unlike the certification column on information_schema.tables (which shows only "
"settled 'certified'/'deprecated' marks), this lists the full review queue — including 'proposed' "
- "rows and the id the certify/deprecate tools need. Filter by status to inspect the queue."
+ "rows and the id the certify/deprecate tools need. Filter by status to inspect the queue; "
+ "proposed_status shows whether a 'proposed' row asks to certify or deprecate the target."
)
_RELATIONSHIP_PROPOSALS_COLUMNS: list[tuple[str, str]] = [
@@ -1221,6 +1223,7 @@ def _catalog_certification_rows(context: "HogQLContext", allowed: Optional[froze
target_id,
target_kind,
cert.status,
+ cert.proposed_status,
cert.notes or None,
cert.certified_by.email if cert.certified_by else None,
cert.certified_at.isoformat() if cert.certified_at else None,
@@ -1549,6 +1552,13 @@ class InformationSchemaCertificationsTable(LazyTable):
"Only 'certified'/'deprecated' are trust marks; a 'proposed' row is not yet vouched for."
),
),
+ "proposed_status": _string_field(
+ "proposed_status",
+ description=(
+ "The mark the proposal asks for: 'certified' (trust this source) or 'deprecated' (avoid it). "
+ "Informational once the row is settled."
+ ),
+ ),
"notes": _string_field("notes", nullable=True, description="Why the mark exists; review context."),
"certified_by": _string_field(
"certified_by",
diff --git a/products/data_catalog/backend/logic/analytics.py b/products/data_catalog/backend/logic/analytics.py
index 800d116062d4..0eb5a51bf73e 100644
--- a/products/data_catalog/backend/logic/analytics.py
+++ b/products/data_catalog/backend/logic/analytics.py
@@ -81,6 +81,7 @@ def capture_certification_event(
{
"certification_id": str(cert.id),
"status": cert.status,
+ "proposed_status": cert.proposed_status,
"target": certification_target_name(cert),
"target_kind": "table" if cert.table_id else "view",
},
diff --git a/products/data_catalog/backend/logic/certifications.py b/products/data_catalog/backend/logic/certifications.py
index c3b2b844dc6a..e29262ea2d1a 100644
--- a/products/data_catalog/backend/logic/certifications.py
+++ b/products/data_catalog/backend/logic/certifications.py
@@ -104,8 +104,11 @@ def propose_certification(
table_name: str | None = None,
view_name: str | None = None,
notes: str = "",
+ proposed_status: str = CertificationStatus.CERTIFIED,
request: "Request | None" = None,
) -> TableCertification:
+ if proposed_status not in (CertificationStatus.CERTIFIED, CertificationStatus.DEPRECATED):
+ raise ValidationError({"proposed_status": "Must be 'certified' or 'deprecated'."})
selectors = {
"table_id": table_id,
"saved_query_id": saved_query_id,
@@ -133,6 +136,7 @@ def propose_certification(
table=target_table,
saved_query=target_saved_query,
notes=notes,
+ proposed_status=proposed_status,
created_by=user,
)
except IntegrityError:
diff --git a/products/data_catalog/backend/migrations/0004_tablecertification_proposed_status.py b/products/data_catalog/backend/migrations/0004_tablecertification_proposed_status.py
new file mode 100644
index 000000000000..96c64c59d5ed
--- /dev/null
+++ b/products/data_catalog/backend/migrations/0004_tablecertification_proposed_status.py
@@ -0,0 +1,24 @@
+# Generated by Django 5.2.14 on 2026-08-03 14:29
+
+from django.db import migrations, models
+
+import products.data_catalog.backend.facade.enums
+
+
+class Migration(migrations.Migration):
+ dependencies = [
+ ("data_catalog", "0003_relationshipproposal"),
+ ]
+
+ operations = [
+ migrations.AddField(
+ model_name="tablecertification",
+ name="proposed_status",
+ field=models.CharField(
+ choices=[("certified", "certified"), ("deprecated", "deprecated")],
+ default=products.data_catalog.backend.facade.enums.CertificationStatus["CERTIFIED"],
+ help_text="The mark this proposal asks for: 'certified' (trust this source) or 'deprecated' (avoid this source). Informational once the mark is settled.",
+ max_length=32,
+ ),
+ ),
+ ]
diff --git a/products/data_catalog/backend/migrations/max_migration.txt b/products/data_catalog/backend/migrations/max_migration.txt
index b4cff360607d..c6dcdaf65d3a 100644
--- a/products/data_catalog/backend/migrations/max_migration.txt
+++ b/products/data_catalog/backend/migrations/max_migration.txt
@@ -1 +1 @@
-0003_relationshipproposal
+0004_tablecertification_proposed_status
diff --git a/products/data_catalog/backend/models/certification.py b/products/data_catalog/backend/models/certification.py
index ed22e5114151..79fe067c20a3 100644
--- a/products/data_catalog/backend/models/certification.py
+++ b/products/data_catalog/backend/models/certification.py
@@ -49,6 +49,16 @@ class TableCertification(CreatedMetaFields, UpdatedMetaFields, UUIDModel):
default=CertificationStatus.PROPOSED,
help_text="proposed, certified (prefer this source), or deprecated (avoid this source).",
)
+ proposed_status = models.CharField(
+ max_length=32,
+ choices=[
+ (CertificationStatus.CERTIFIED.value, CertificationStatus.CERTIFIED.value),
+ (CertificationStatus.DEPRECATED.value, CertificationStatus.DEPRECATED.value),
+ ],
+ default=CertificationStatus.CERTIFIED,
+ help_text="The mark this proposal asks for: 'certified' (trust this source) or 'deprecated' "
+ "(avoid this source). Informational once the mark is settled.",
+ )
notes = models.TextField(
blank=True, help_text="Why this mark exists, e.g. 'canonical MRR source, refreshed daily'."
)
diff --git a/products/data_catalog/backend/presentation/serializers.py b/products/data_catalog/backend/presentation/serializers.py
index d4772ada4a37..3796460a379c 100644
--- a/products/data_catalog/backend/presentation/serializers.py
+++ b/products/data_catalog/backend/presentation/serializers.py
@@ -188,6 +188,11 @@ class CertificationSerializer(serializers.ModelSerializer):
status = serializers.CharField(
read_only=True, help_text="proposed, certified (prefer this source), or deprecated (avoid this source)."
)
+ proposed_status = serializers.CharField(
+ read_only=True,
+ help_text="The mark the proposal asks for: 'certified' (trust this source) or 'deprecated' "
+ "(avoid this source). Informational once the mark is settled.",
+ )
target_type = serializers.SerializerMethodField(help_text="Whether the marked target is a 'table' or a 'view'.")
target_name = serializers.SerializerMethodField(help_text="Name of the marked table or view.")
certified_by = UserBasicSerializer(
@@ -203,6 +208,7 @@ class CertificationSerializer(serializers.ModelSerializer):
"target_type",
"target_name",
"status",
+ "proposed_status",
"notes",
"certified_by",
"certified_at",
@@ -214,6 +220,7 @@ class CertificationSerializer(serializers.ModelSerializer):
"table",
"saved_query",
"status",
+ "proposed_status",
"certified_by",
"certified_at",
"created_by",
@@ -240,6 +247,13 @@ class CertificationCreateSerializer(serializers.Serializer):
table_name = serializers.CharField(required=False, help_text="Table name; 409 with candidates if ambiguous.")
view_name = serializers.CharField(required=False, help_text="View name; 409 with candidates if ambiguous.")
notes = serializers.CharField(required=False, allow_blank=True, help_text="Why this mark exists.")
+ proposed_status = serializers.ChoiceField(
+ choices=["certified", "deprecated"],
+ required=False,
+ default="certified",
+ help_text="Intent of the proposal: 'certified' to propose trusting this source, "
+ "'deprecated' to propose avoiding it (e.g. a stale or wrong source).",
+ )
@extend_schema_serializer(component_name="DataCatalogRelationshipProposal")
diff --git a/products/data_catalog/backend/tests/test_certifications.py b/products/data_catalog/backend/tests/test_certifications.py
index 9c5f5a3440d7..6a158a8cd878 100644
--- a/products/data_catalog/backend/tests/test_certifications.py
+++ b/products/data_catalog/backend/tests/test_certifications.py
@@ -88,10 +88,26 @@ class TestCertificationLogic(BaseTest):
certification = propose_certification(team=self.team, user=self.user, **selector_kwargs)
assert certification.status == CertificationStatus.PROPOSED
+ assert certification.proposed_status == CertificationStatus.CERTIFIED
assert certification.created_by_id == self.user.id
assert certification.table_id == (target.id if target_type == "table" else None)
assert certification.saved_query_id == (target.id if target_type == "view" else None)
+ def test_propose_deprecation_records_intent_and_settles(self) -> None:
+ table = _table(self.team)
+ cert = propose_certification(
+ team=self.team, user=self.user, table_id=str(table.id), proposed_status=CertificationStatus.DEPRECATED
+ )
+ assert cert.status == CertificationStatus.PROPOSED
+ assert cert.proposed_status == CertificationStatus.DEPRECATED
+
+ assert deprecate(cert, self.user).status == CertificationStatus.DEPRECATED
+
+ def test_propose_rejects_invalid_proposed_status(self) -> None:
+ table = _table(self.team)
+ with self.assertRaisesMessage(ValidationError, "certified"):
+ propose_certification(team=self.team, user=self.user, table_id=str(table.id), proposed_status="proposed")
+
def test_ambiguous_table_name_returns_candidates(self) -> None:
_table(self.team, name="dupe")
_table(self.team, name="dupe")
@@ -248,6 +264,25 @@ class TestCertificationAPI(APIBaseTest):
assert certified.status_code == status.HTTP_200_OK
assert certified.json()["status"] == CertificationStatus.CERTIFIED
+ def test_propose_deprecation_and_settle(self) -> None:
+ table = _table(self.team)
+ created = self.client.post(
+ self.url, {"table_id": str(table.id), "proposed_status": "deprecated"}, format="json"
+ )
+ assert created.status_code == status.HTTP_201_CREATED, created.json()
+ body = created.json()
+ assert body["status"] == CertificationStatus.PROPOSED
+ assert body["proposed_status"] == CertificationStatus.DEPRECATED
+
+ deprecated = self.client.post(f"{self.url}{body['id']}/deprecate/")
+ assert deprecated.status_code == status.HTTP_200_OK
+ assert deprecated.json()["status"] == CertificationStatus.DEPRECATED
+
+ def test_create_rejects_invalid_proposed_status(self) -> None:
+ table = _table(self.team)
+ response = self.client.post(self.url, {"table_id": str(table.id), "proposed_status": "proposed"}, format="json")
+ assert response.status_code == status.HTTP_400_BAD_REQUEST
+
def test_ambiguous_table_name_returns_409_with_candidates(self) -> None:
# The conflict must render through the HTTP exception handler — a shape it can't
# serialize turns every ambiguous propose into a 500 and hides the candidate ids
diff --git a/products/data_catalog/backend/tests/test_information_schema.py b/products/data_catalog/backend/tests/test_information_schema.py
index 242caf258c58..10114b0cbed6 100644
--- a/products/data_catalog/backend/tests/test_information_schema.py
+++ b/products/data_catalog/backend/tests/test_information_schema.py
@@ -18,6 +18,7 @@ from posthog.hogql.query import execute_hogql_query
from posthog.constants import AvailableFeature
from posthog.models.team import Team
+from products.data_catalog.backend.facade.enums import CertificationStatus
from products.data_catalog.backend.logic import relationships
from products.data_catalog.backend.logic.certifications import certify, deprecate, propose_certification
from products.data_catalog.backend.logic.metrics import upsert_metric
@@ -750,6 +751,27 @@ class TestInformationSchemaCertificationsAndRelationships(ClickhouseTestMixin, A
)
assert response.results == [(str(cert.id), "cert_sales_view", str(view.id), "view", "proposed")]
+ def test_deprecation_proposal_shows_intent_but_is_not_a_trust_mark(self) -> None:
+ table = self._create_warehouse_table("cert_stale")
+ propose_certification(
+ team=self.team, user=self.user, table_id=str(table.id), proposed_status=CertificationStatus.DEPRECATED
+ )
+
+ queue = execute_hogql_query(
+ "SELECT status, proposed_status FROM system.information_schema.certifications "
+ "WHERE target_name = 'cert_stale'",
+ team=self.team,
+ context=self._context(),
+ )
+ assert queue.results == [("proposed", "deprecated")]
+
+ settled = execute_hogql_query(
+ "SELECT certification FROM system.information_schema.tables WHERE table_name = 'cert_stale'",
+ team=self.team,
+ context=self._context(),
+ )
+ assert settled.results == [(None,)]
+
def test_certifications_table_target_id_disambiguates_same_name(self) -> None:
# (team, name) is not unique on DataWarehouseTable, so the queue must expose target_id — otherwise
# a human can't tell which physical table a certification UUID will certify or deprecate.
diff --git a/products/data_catalog/frontend/certificationsLogic.test.ts b/products/data_catalog/frontend/certificationsLogic.test.ts
index 580c882a2ff2..bf7b5c9d7947 100644
--- a/products/data_catalog/frontend/certificationsLogic.test.ts
+++ b/products/data_catalog/frontend/certificationsLogic.test.ts
@@ -6,6 +6,7 @@ import { expectLogic } from '~/test/keaTestUtils'
import { certificationsLogic } from './certificationsLogic'
import {
dataCatalogCertificationsCertifyCreate,
+ dataCatalogCertificationsCreate,
dataCatalogCertificationsDestroy,
dataCatalogCertificationsList,
} from './generated/api'
@@ -95,6 +96,22 @@ describe('certificationsLogic', () => {
expect(mockLoadDatabase).toHaveBeenCalledWith({ force: true })
})
+ it('sends the proposal intent when creating', async () => {
+ ;(dataCatalogCertificationsCreate as jest.Mock).mockResolvedValue(
+ buildCertification({ id: 'cert-3', status: 'proposed' })
+ )
+
+ logic.actions.setNewCertificationForm({ targetName: 'stale_revenue', proposedStatus: 'deprecated' })
+ logic.actions.createCertification()
+ await expectLogic(logic).toFinishAllListeners()
+
+ expect(dataCatalogCertificationsCreate).toHaveBeenCalledWith('1', {
+ table_name: 'stale_revenue',
+ notes: undefined,
+ proposed_status: 'deprecated',
+ })
+ })
+
it('removes the row when revoking', async () => {
;(dataCatalogCertificationsDestroy as jest.Mock).mockResolvedValue(undefined)
diff --git a/products/data_catalog/frontend/certificationsLogic.tsx b/products/data_catalog/frontend/certificationsLogic.tsx
index 53b06e983d6d..b73aeb505f57 100644
--- a/products/data_catalog/frontend/certificationsLogic.tsx
+++ b/products/data_catalog/frontend/certificationsLogic.tsx
@@ -15,17 +15,20 @@ import {
import type { DataCatalogCertificationApi } from './generated/api.schemas'
export type CertificationTargetType = 'table' | 'view'
+export type ProposedStatus = 'certified' | 'deprecated'
export interface NewCertificationForm {
targetName: string
targetType: CertificationTargetType
notes: string
+ proposedStatus: ProposedStatus
}
export const EMPTY_NEW_CERTIFICATION_FORM: NewCertificationForm = {
targetName: '',
targetType: 'table',
notes: '',
+ proposedStatus: 'certified',
}
function projectId(): string {
@@ -222,12 +225,15 @@ export const certificationsLogic = kea<certificationsLogicType>([
? { view_name: form.targetName }
: { table_name: form.targetName }),
notes: form.notes || undefined,
+ proposed_status: form.proposedStatus,
})
actions.loadCertificationsSuccess([created, ...values.certifications])
actions.closeNewCertificationModal()
- lemonToast.success('Certification proposed')
+ lemonToast.success(
+ form.proposedStatus === 'deprecated' ? 'Deprecation proposed' : 'Certification proposed'
+ )
} catch (error) {
- lemonToast.error(apiErrorDetail(error) || 'Could not propose the certification. Try again.')
+ lemonToast.error(apiErrorDetail(error) || 'Could not create the proposal. Try again.')
} finally {
actions.setCreatingCertification(false)
}
diff --git a/products/data_catalog/frontend/components/NewCertificationModal.tsx b/products/data_catalog/frontend/components/NewCertificationModal.tsx
index 9a99808c097d..4545691cc176 100644
--- a/products/data_catalog/frontend/components/NewCertificationModal.tsx
+++ b/products/data_catalog/frontend/components/NewCertificationModal.tsx
@@ -3,11 +3,12 @@ import { useActions, useValues } from 'kea'
import { LemonButton } from 'lib/lemon-ui/LemonButton'
import { LemonField } from 'lib/lemon-ui/LemonField'
import { LemonModal } from 'lib/lemon-ui/LemonModal'
+import { LemonSegmentedButton } from 'lib/lemon-ui/LemonSegmentedButton'
import { LemonSelect } from 'lib/lemon-ui/LemonSelect'
import { LemonTextArea } from 'lib/lemon-ui/LemonTextArea'
import { databaseTableListLogic } from 'scenes/data-management/database/databaseTableListLogic'
-import { CertificationTargetType, certificationsLogic } from '../certificationsLogic'
+import { CertificationTargetType, ProposedStatus, certificationsLogic } from '../certificationsLogic'
const VIEW_TABLE_TYPES = new Set(['view', 'materialized_view', 'managed_view'])
@@ -51,13 +52,14 @@ export function NewCertificationModal(): JSX.Element {
: null
const submitDisabledReason = !newCertificationForm.targetName ? 'Choose a table or view' : undefined
+ const proposingDeprecation = newCertificationForm.proposedStatus === 'deprecated'
return (
<LemonModal
isOpen={newCertificationModalOpen}
onClose={closeNewCertificationModal}
width={560}
- title="Propose a certification"
+ title="Propose a trust mark"
>
<LemonModal.Content>
<div className="flex flex-col gap-4">
@@ -78,11 +80,29 @@ export function NewCertificationModal(): JSX.Element {
/>
</LemonField.Pure>
+ <LemonField.Pure label="Proposal">
+ <LemonSegmentedButton
+ value={newCertificationForm.proposedStatus}
+ onChange={(proposedStatus: ProposedStatus) => setNewCertificationForm({ proposedStatus })}
+ options={[
+ { value: 'certified', label: 'Certify - trust this source' },
+ { value: 'deprecated', label: 'Deprecate - avoid this source' },
+ ]}
+ fullWidth
+ size="small"
+ data-attr="data-catalog-certification-proposed-status"
+ />
+ </LemonField.Pure>
+
<LemonField.Pure label="Notes">
<LemonTextArea
value={newCertificationForm.notes}
onChange={(notes) => setNewCertificationForm({ notes })}
- placeholder="Why should the team trust this source?"
+ placeholder={
+ proposingDeprecation
+ ? 'Why should the team avoid this source?'
+ : 'Why should the team trust this source?'
+ }
minRows={2}
/>
</LemonField.Pure>
@@ -100,7 +120,7 @@ export function NewCertificationModal(): JSX.Element {
disabledReason={submitDisabledReason}
data-attr="data-catalog-create-certification-submit"
>
- Propose certification
+ {proposingDeprecation ? 'Propose deprecation' : 'Propose certification'}
</LemonButton>
</LemonModal.Footer>
</LemonModal>
diff --git a/products/data_catalog/frontend/generated/api.schemas.ts b/products/data_catalog/frontend/generated/api.schemas.ts
index fdba1cc33b78..7aea4dc23acf 100644
--- a/products/data_catalog/frontend/generated/api.schemas.ts
+++ b/products/data_catalog/frontend/generated/api.schemas.ts
@@ -82,6 +82,8 @@ export interface DataCatalogCertificationApi {
readonly target_name: string
/** proposed, certified (prefer this source), or deprecated (avoid this source). */
readonly status: string
+ /** The mark the proposal asks for: 'certified' (trust this source) or 'deprecated' (avoid this source). Informational once the mark is settled. */
+ readonly proposed_status: string
/** Why this mark exists, e.g. 'canonical MRR source'. */
notes?: string
/** User who last set certified/deprecated, or null. */
@@ -102,6 +104,17 @@ export interface PaginatedDataCatalogCertificationListApi {
results: DataCatalogCertificationApi[]
}
+/**
+ * * `certified` - certified
+ * * `deprecated` - deprecated
+ */
+export type ProposedStatusEnumApi = (typeof ProposedStatusEnumApi)[keyof typeof ProposedStatusEnumApi]
+
+export const ProposedStatusEnumApi = {
+ Certified: 'certified',
+ Deprecated: 'deprecated',
+} as const
+
/**
* Input for proposing a certification: address the target by id or (convenience) by name.
*/
@@ -116,6 +129,11 @@ export interface CertificationCreateApi {
view_name?: string
/** Why this mark exists. */
notes?: string
+ /** Intent of the proposal: 'certified' to propose trusting this source, 'deprecated' to propose avoiding it (e.g. a stale or wrong source).
+ *
+ * * `certified` - certified
+ * * `deprecated` - deprecated */
+ proposed_status?: ProposedStatusEnumApi
}
/**
diff --git a/products/data_catalog/frontend/generated/api.zod.ts b/products/data_catalog/frontend/generated/api.zod.ts
index 1d5021fa1ae3..b69faf9093ca 100644
--- a/products/data_catalog/frontend/generated/api.zod.ts
+++ b/products/data_catalog/frontend/generated/api.zod.ts
@@ -12,6 +12,8 @@ import * as zod from 'zod'
/**
* Trust marks on warehouse tables and views. Reads exclude soft-deleted targets.
*/
+export const dataCatalogCertificationsCreateBodyProposedStatusDefault = `certified`
+
export const DataCatalogCertificationsCreateBody = /* @__PURE__ */ zod
.object({
table_id: zod.uuid().optional().describe('Warehouse table id to certify (XOR the other targets).'),
@@ -19,6 +21,13 @@ export const DataCatalogCertificationsCreateBody = /* @__PURE__ */ zod
table_name: zod.string().optional().describe('Table name; 409 with candidates if ambiguous.'),
view_name: zod.string().optional().describe('View name; 409 with candidates if ambiguous.'),
notes: zod.string().optional().describe('Why this mark exists.'),
+ proposed_status: zod
+ .enum(['certified', 'deprecated'])
+ .describe('\* `certified` - certified\n\* `deprecated` - deprecated')
+ .default(dataCatalogCertificationsCreateBodyProposedStatusDefault)
+ .describe(
+ "Intent of the proposal: 'certified' to propose trusting this source, 'deprecated' to propose avoiding it (e.g. a stale or wrong source).\n\n\* `certified` - certified\n\* `deprecated` - deprecated"
+ ),
})
.describe('Input for proposing a certification: address the target by id or (convenience) by name.')
diff --git a/products/data_catalog/frontend/tabs/CertificationsTab.tsx b/products/data_catalog/frontend/tabs/CertificationsTab.tsx
index 4e9e42784637..d1b42dbd00fe 100644
--- a/products/data_catalog/frontend/tabs/CertificationsTab.tsx
+++ b/products/data_catalog/frontend/tabs/CertificationsTab.tsx
@@ -59,7 +59,10 @@ export function CertificationsTab(): JSX.Element {
title: 'Status',
key: 'status',
render: (_, certification) => {
- const tag = STATUS_TAG[certification.status] ?? { label: certification.status, type: 'muted' as const }
+ const tag =
+ certification.status === 'proposed' && certification.proposed_status === 'deprecated'
+ ? { label: 'Deprecation proposed', type: 'warning' as const }
+ : (STATUS_TAG[certification.status] ?? { label: certification.status, type: 'muted' as const })
return <LemonTag type={tag.type}>{tag.label}</LemonTag>
},
},
@@ -92,7 +95,7 @@ export function CertificationsTab(): JSX.Element {
Certify
</LemonButton>
)}
- {certification.status === 'certified' && (
+ {certification.status !== 'deprecated' && (
<LemonButton
fullWidth
loading={inFlight}
diff --git a/products/data_catalog/mcp/tools.yaml b/products/data_catalog/mcp/tools.yaml
index 6430b815f574..7b7dd8f98790 100644
--- a/products/data_catalog/mcp/tools.yaml
+++ b/products/data_catalog/mcp/tools.yaml
@@ -59,7 +59,8 @@ tools:
title: Propose a table/view certification
description: >
Propose a trust mark on a warehouse table or view. Address the target by id, or by name (an ambiguous name
- returns the candidate ids to pick from).
+ returns the candidate ids to pick from). Pass proposed_status 'deprecated' to propose deprecating a stale or
+ wrong source; an approver settles the proposal with the certify or deprecate tool.
feature_flag: product-data-catalog
data-catalog-certifications-destroy:
operation: data_catalog_certifications_destroy
diff --git a/services/mcp/schema/generated-tool-definitions.json b/services/mcp/schema/generated-tool-definitions.json
index f9db42cbe071..c33797125a51 100644
--- a/services/mcp/schema/generated-tool-definitions.json
+++ b/services/mcp/schema/generated-tool-definitions.json
@@ -2229,7 +2229,7 @@
"feature_flag": "product-data-catalog"
},
"data-catalog-certification-propose": {
- "description": "Propose a trust mark on a warehouse table or view. Address the target by id, or by name (an ambiguous name returns the candidate ids to pick from).",
+ "description": "Propose a trust mark on a warehouse table or view. Address the target by id, or by name (an ambiguous name returns the candidate ids to pick from). Pass proposed_status 'deprecated' to propose deprecating a stale or wrong source; an approver settles the proposal with the certify or deprecate tool.",
"category": "Data catalog",
"feature": "data_catalog",
"summary": "Propose a table/view certification",
diff --git a/services/mcp/schema/tool-definitions-all.json b/services/mcp/schema/tool-definitions-all.json
index 2de332181406..23323727ec3c 100644
--- a/services/mcp/schema/tool-definitions-all.json
+++ b/services/mcp/schema/tool-definitions-all.json
@@ -2244,7 +2244,7 @@
"feature_flag": "product-data-catalog"
},
"data-catalog-certification-propose": {
- "description": "Propose a trust mark on a warehouse table or view. Address the target by id, or by name (an ambiguous name returns the candidate ids to pick from).",
+ "description": "Propose a trust mark on a warehouse table or view. Address the target by id, or by name (an ambiguous name returns the candidate ids to pick from). Pass proposed_status 'deprecated' to propose deprecating a stale or wrong source; an approver settles the proposal with the certify or deprecate tool.",
"category": "Data catalog",
"feature": "data_catalog",
"summary": "Propose a table/view certification",
diff --git a/services/mcp/src/api/generated.ts b/services/mcp/src/api/generated.ts
index 1076739991cf..078c2b207c1d 100644
--- a/services/mcp/src/api/generated.ts
+++ b/services/mcp/src/api/generated.ts
@@ -13906,6 +13906,18 @@ export namespace Schemas {
Both: 'both',
} as const;
+ /**
+ * * `certified` - certified
+ * * `deprecated` - deprecated
+ */
+ export type ProposedStatusEnum = typeof ProposedStatusEnum[keyof typeof ProposedStatusEnum];
+
+
+ export const ProposedStatusEnum = {
+ Certified: 'certified',
+ Deprecated: 'deprecated',
+ } as const;
+
/**
* Input for proposing a certification: address the target by id or (convenience) by name.
*/
@@ -13920,6 +13932,11 @@ export namespace Schemas {
view_name?: string;
/** Why this mark exists. */
notes?: string;
+ /** Intent of the proposal: 'certified' to propose trusting this source, 'deprecated' to propose avoiding it (e.g. a stale or wrong source).
+ *
+ * * `certified` - certified
+ * * `deprecated` - deprecated */
+ proposed_status?: ProposedStatusEnum;
}
export type ChangeRequestApprovalsItem = { [key: string]: unknown };
@@ -17183,6 +17200,8 @@ export namespace Schemas {
readonly target_name: string;
/** proposed, certified (prefer this source), or deprecated (avoid this source). */
readonly status: string;
+ /** The mark the proposal asks for: 'certified' (trust this source) or 'deprecated' (avoid this source). Informational once the mark is settled. */
+ readonly proposed_status: string;
/** Why this mark exists, e.g. 'canonical MRR source'. */
notes?: string;
/** User who last set certified/deprecated, or null. */
diff --git a/services/mcp/src/generated/data_catalog/api.ts b/services/mcp/src/generated/data_catalog/api.ts
index a38f1db7c4c9..ef314c326c9d 100644
--- a/services/mcp/src/generated/data_catalog/api.ts
+++ b/services/mcp/src/generated/data_catalog/api.ts
@@ -19,6 +19,8 @@ export const DataCatalogCertificationsCreateParams = /* @__PURE__ */ zod.object(
),
})
+export const dataCatalogCertificationsCreateBodyProposedStatusDefault = `certified`
+
export const DataCatalogCertificationsCreateBody = /* @__PURE__ */ zod
.object({
table_id: zod.string().optional().describe('Warehouse table id to certify (XOR the other targets).'),
@@ -26,6 +28,13 @@ export const DataCatalogCertificationsCreateBody = /* @__PURE__ */ zod
table_name: zod.string().optional().describe('Table name; 409 with candidates if ambiguous.'),
view_name: zod.string().optional().describe('View name; 409 with candidates if ambiguous.'),
notes: zod.string().optional().describe('Why this mark exists.'),
+ proposed_status: zod
+ .enum(['certified', 'deprecated'])
+ .describe('\* `certified` - certified\n\* `deprecated` - deprecated')
+ .default(dataCatalogCertificationsCreateBodyProposedStatusDefault)
+ .describe(
+ "Intent of the proposal: 'certified' to propose trusting this source, 'deprecated' to propose avoiding it (e.g. a stale or wrong source).\n\n\* `certified` - certified\n\* `deprecated` - deprecated"
+ ),
})
.describe('Input for proposing a certification: address the target by id or (convenience) by name.')
diff --git a/services/mcp/src/tools/generated/data_catalog.ts b/services/mcp/src/tools/generated/data_catalog.ts
index 9a36c651768c..f6d1134915e7 100644
--- a/services/mcp/src/tools/generated/data_catalog.ts
+++ b/services/mcp/src/tools/generated/data_catalog.ts
@@ -183,6 +183,9 @@ const dataCatalogCertificationPropose = (): ToolBase<
if (params.notes !== undefined) {
body['notes'] = params.notes
}
+ if (params.proposed_status !== undefined) {
+ body['proposed_status'] = params.proposed_status
+ }
const result = await context.api.request<Schemas.DataCatalogCertification>({
method: 'POST',
path: `/api/projects/${encodeURIComponent(String(projectId))}/data_catalog/certifications/`,