A data engineer defines the following DLT pipeline table:
@dlt.table
@dlt.expect_or_fail("non_negative_amount", "amount >= 0")
def validated_transactions():
return dlt.read("raw_transactions")
During a pipeline run, 3 records arrive with amount = -5. What happens?
- A. The 3 records are written to the output table with a
_violated_expectationsmetadata column. - B. The 3 invalid records are quarantined into a separate DLT quarantine table.
- C. The pipeline completes successfully but logs the 3 violations as warnings in the DLT event log.
- D. The entire pipeline update fails immediately when the first invalid record is encountered.✓ Correct
- E. The 3 invalid records are silently dropped and the pipeline continues normally.
Explanation
@dlt.expect_or_fail is the strictest DLT expectation mode — if any single record violates the constraint, the entire pipeline update is halted and marked as failed. This is appropriate for data quality gates where bad data must never proceed. @dlt.expect (warn) would log violations without stopping the pipeline. @dlt.expect_or_drop would silently drop violating rows and continue. DLT does not automatically create quarantine tables unless the engineer explicitly defines one using a filter. There is no _violated_expectations column added automatically by DLT.