Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-19-2025 06:05 AM
I have a question about how expectations work when applied to views inside a Delta Live Tables (DLT) pipeline. For instance, suppose we define this view inside a pipeline to stop the pipeline if we spot some duplicates:
@Dlt.view(
name=view_name,
)
@dlt.expect_or_fail(expectation, "duplicate = 1")
def generate_report():
return (
dlt.read(table)
.groupBy(keys)
.agg(count("*").alias("duplicate"))
)What is happening behind the scenes? Is the expectation validated as a "temporary table" (computed but not stored in the catalog), or is it validated only if the view is used by a table defined in the pipeline?
Labels:
- Labels:
-
Workflows