feat(ingestion/unity): ingest Lakeflow pipeline expectations as assertions - #19755
feat(ingestion/unity): ingest Lakeflow pipeline expectations as assertions#19755acrylJonny wants to merge 7 commits into
Conversation
PR SummaryOverview When enabled, the source lists pipelines, reads each pipeline’s event log over the REST API (no SQL warehouse), aggregates only the latest update (summing micro-batch Docs cover config, behavior, and Reviewed by Cursor Bugbot for commit a939387. Bugbot is set up for automated code reviews on this repo. Configure here. |
Codecov Report❌ Patch coverage is 📢 Thoughts on this report? Let us know! |
There was a problem hiding this comment.
All reported issues were addressed
Reply with feedback, questions, or to request a fix.
Re-trigger cubic
There was a problem hiding this comment.
All reported issues were addressed across 3 files (changes from recent commits).
Reply with feedback, questions, or to request a fix.
Re-trigger cubic
eb861a3 to
18634a9
Compare
Connector Tests ResultsAll connector tests passed for commit To skip connector tests, add the Autogenerated by the connector-tests CI pipeline. |
There was a problem hiding this comment.
All reported issues were addressed across 6 files (changes from recent commits).
Tip: Review your code locally with the cubic CLI to iterate faster.
Re-trigger cubic
43483d4 to
b658a62
Compare
b658a62 to
b4c9ca9
Compare
b4c9ca9 to
7d805d3
Compare
…tions Publishes Lakeflow Declarative Pipelines (formerly Delta Live Tables) expectation results as DataHub dataset assertions. The pipeline event log is read over the REST API (no SQL warehouse required); for each pipeline's latest update, an expectation's passed/failed record counts become a dataset-scoped assertion plus a per-run result. Disabled by default behind pipeline_expectations.enabled. Co-authored-by: Cursor <cursoragent@cursor.com>
Lakeflow reports the expectation's dataset as catalog.schema.table on Unity Catalog pipelines, not a bare table name. The extractor was always prepending the pipeline target catalog/schema, producing a broken 5-part dataset URN. Parse the qualified name and fall back to the pipeline target only for missing components. Verified end-to-end against a live pipeline run. Co-authored-by: Cursor <cursoragent@cursor.com>
Emit Lakeflow pipeline expectations as structured custom assertions (scope/operator/aggregation/nativeType) mirroring the dbt connector's row-level native test, instead of a hand-written "Pipeline expectation" description. DataHub now renders "Dataset rows are passing assertion <expectation>", groups under the "Databricks" provider, and carries the expectation name as the native check type. Co-authored-by: Cursor <cursoragent@cursor.com>
Address review feedback on the Lakeflow expectations extractor: - Per-pipeline target lookup failures are caught and reported, so one bad pipeline no longer aborts extraction for the rest. - Read the pipeline event log to page-token exhaustion via a lazy generator, stopping once the newest update is consumed. Removes the fixed 20-page cap that could silently truncate events and undercount failures. - Include the metastore id in the assertion's dataset URN when include_metastore is enabled, so it resolves to the published dataset. - Split dataset identifiers on unquoted dots (handles backtick-quoted parts). - Extract expectations before the warehouse-gated profiling block, so the REST-only path still runs when the SQL warehouse fails to start. - Add tests for schema-qualified/quoted/metastore URN resolution, per-pipeline target errors, and graceful degradation on malformed event payloads. Co-authored-by: Cursor <cursoragent@cursor.com>
Give each Lakeflow (DLT) expectation its own custom assertion type
("Databricks Pipeline Expectation") and carry the expectation name in the
description so it is distinguishable in the assertions list (the list renders a
custom assertion's name from its description, not the structured native fields).
Surface the expectation's action (ALLOW/DROP/FAIL) as a custom property and map
it to failure severity: expect_or_fail / expect_or_drop are hard failures (HIGH),
a plain expect only warns (LOW).
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
…erns Pipeline expectations are discovered from the event log independently of table ingestion, so a pipeline could reference datasets the recipe excluded (or intermediate pipeline views), producing assertions on entities that were never ingested. Apply the connector's catalog/schema/table filters before emitting, mirroring the table-ingestion path, and count skipped datasets in the report. Also make the metastore URN test non-vacuous: the fake dataset-URN builder now mirrors production gen_dataset_urn (str(ref)), so the test fails if the extractor stops threading the metastore through. Drop remaining other-connector references from assertion comments. Co-authored-by: Cursor <cursoragent@cursor.com>
0de79a6 to
a939387
Compare
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using high effort and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit a939387. Configure here.
| self.config.catalog_pattern.allowed(catalog_id) | ||
| and self.config.schema_pattern.allowed(schema_id) | ||
| and self.config.table_pattern.allowed(ref.qualified_table_name) | ||
| ) |
There was a problem hiding this comment.
Incomplete dataset ingest filters
Medium Severity
_pipeline_dataset_allowed only reapplies catalog_pattern, schema_pattern, and table_pattern. It ignores the catalogs allowlist that actually selects which catalogs are ingested, plus include_views / view_pattern / include_tables. Lakeflow datasets are often materialized views, so expectations can be published for entities this run never ingested.
Reviewed by Cursor Bugbot for commit a939387. Configure here.


Summary
Adds ingestion of Lakeflow Declarative Pipelines (formerly Delta Live Tables) expectation results as DataHub dataset assertions, in the Unity Catalog connector.
When
pipeline_expectations.enabled: true, the connector lists the workspace's pipelines, reads each pipeline's event log, and for the most recent update emits a dataset-scoped assertion (plus a per-run result) for every expectation defined on a dataset. An expectation passes when no records failed it.This is a pull-based sibling to the data-quality-monitor assertions added previously — a different source (pipeline event log vs. monitor profile-metrics table), so it lives in its own extractor.
Design notes
GET /api/2.0/pipelines/{id}/events) rather than the SQLevent_log()table-valued function. The raw REST endpoint is used because the typed SDKPipelineEventmodel drops thedetailspayload that carries the expectation metrics, and because the SQL TVF is owner-only.catalogandschema. Pipelines without a UC target are skipped and reported.Rows meet expectation amount_positive), so expectations are distinguishable in the assertions list.expect_or_fail/expect_or_dropviolations are recorded at high severity, a plainexpect(warn-only) at low.pipeline_expectations.enabled.Checklist
Summary by cubic
Previously, Lakeflow pipeline expectations were not ingested; now the Unity Catalog connector publishes them as dataset assertions, with expectation dataset names (including fully-qualified and backtick-quoted identifiers) resolved correctly instead of being re-prefixed with the pipeline target.
pipeline_expectations.enabled;pipeline_patternoptionally filters which pipelines to read, and the catalog/schema/table patterns also apply per dataset so no assertions land on excluded tables.expect_or_fail/expect_or_dropfailures are high severity while plainexpectis low.include_metastore.CAN_VIEWon pipelines whose expectations should be published.Written for commit a939387. Summary will update on new commits.