Databricks-DE-Pro Developing Code (Python/SQL) Practice Question
A Data Engineer is developing a Delta Live Tables (DLT) pipeline using Python. They need to ensure that records failing a specific data quality check are dropped, but the pipeline continues to process the remaining valid records. Which expectation syntax should the engineer implement?
⚠ Common exam trap
Candidates often confuse 'expect_or_fail' with 'expect_or_drop'. They mistakenly think the pipeline should stop when a bad record is found, rather than simply dropping the invalid record.
Answer choices
Why each option matters
Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.
Correct answer & explanation
✓
@dlt.expect_or_drop('col_check', 'id IS NOT NULL')
The 'expect_or_drop' constraint is specifically designed for DLT to handle data quality failures gracefully. By using this expectation, the pipeline marks the record as invalid and removes it from the target dataset without halting the entire execution. This is critical in production environments where partial data ingestion is preferred over pipeline failure, ensuring high availability and robust data processing workflows for downstream users.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
@dlt.expect_or_fail('col_check', 'id IS NOT NULL')
Why it's wrong here
This expectation causes the entire pipeline to abort when a validation check fails. In production environments, failing the whole pipeline is often undesirable when only a subset of records is corrupted. It is typically used for critical business requirements where incomplete data sets are unacceptable for downstream reporting purposes.
- ✗
@dlt.expect('col_check', 'id IS NOT NULL')
Why it's wrong here
This expectation only flags the record as invalid in the observation logs but keeps the record in the target table. Using this does not drop the record, which contradicts the requirement to remove invalid data from the final output while allowing the pipeline to continue processing subsequent valid records.
- ✓
@dlt.expect_or_drop('col_check', 'id IS NOT NULL')
Why this is correct
The expect_or_drop constraint removes records that fail the specified validation check while allowing the pipeline execution to continue. This pattern provides a balance between maintaining data quality standards and ensuring pipeline resilience, preventing transient bad data from blocking the ingestion of high-quality records into the target Delta tables.
- ✗
@dlt.validate('col_check', 'id IS NOT NULL')
Why it's wrong here
There is no built-in DLT decorator named validate. DLT expectations are implemented using explicit decorators such as expect, expect_or_drop, or expect_or_fail. Using a non-existent method will lead to an AttributeError during the pipeline compilation phase, preventing the pipeline from starting or correctly enforcing the intended data quality constraints.
About these practice questions
Courseiva writes every Databricks-DE-Pro question from scratch — 267 in total, each with an explanation and a wrong-answer breakdown. None are copied from real exams or dumps. Learn why practice questions differ from exam dumps →
JA
Written and reviewed by Johnson Ajibi, MSc IT Security
Senior Network & Security Engineer · founder of Courseiva
Last reviewed September 2026 · checked against the official Databricks exam blueprint
This Databricks-DE-Pro practice question is part of Courseiva's free Databricks certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the Databricks-DE-Pro exam.