data-quality

Validate PySpark and Delta pipelines with null checks, duplicates, and Lakeflow expectations.

4|1|Updated May 22, 2026
One-click install
npx skills add https://github.com/ThomazRossito/ai-data-agents --skill data-quality-thomazrossito
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: data-quality
Source: https://github.com/ThomazRossito/ai-data-agents/tree/main/plugins/ai-data-agents/skills/data-quality
Command: npx skills add https://github.com/ThomazRossito/ai-data-agents --skill data-quality-thomazrossito

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires pyspark.

What problem does it solve? Data pipelines often ingest incomplete, duplicated, or invalid records that silently corrupt downstream Silver and Gold tables. This Skill provides ready-to-use validation patterns for PySpark/Delta pipelines so bad data is caught, dropped, or blocked before it propagates. ## Core Features & Use Cases - PySpark Validation Reports: Run structural checks on DataFrames covering required columns, null percentages, and duplicate counts, returning a pass/fail report. - Lakeflow/SDP Expectations: Apply declarative data quality constraints using the modern pyspark.pipelines API (dp.expect, dp.expect_or_drop, dp.expect_all) or native SQL CONSTRAINT ... EXPECT clauses with ON VIOLATION policies. - Source-to-Target Reconciliation: Compare row counts and aggregate sums between staging and final tables after a load to detect data loss. - Use Case: After ingesting bronze sales data, define a Silver streaming table with expectations that drop rows missing event dates and fail the update on null IDs, then reconcile totals against the source. ## Quick Start Ask the agent to add data quality expectations and null checks to my Silver layer pipeline for the bronze_vendas table.

Frequently Asked Questions about data-quality

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I add data quality expectations to a Databricks pipeline?▼

Use the pyspark.pipelines API with decorators like @dp.expect, @dp.expect_or_drop, or @dp.expect_all on your table definition. In SQL, use CREATE OR REFRESH STREAMING TABLE with CONSTRAINT ... EXPECT clauses and ON VIOLATION policies such as DROP ROW or FAIL UPDATE.

How to check for nulls and duplicates in a PySpark DataFrame?▼

Filter with F.col(col).isNull() and count to measure nulls per required column, and compare df.count() against df.dropDuplicates().count() for duplicates. The Skill's validate_dataframe function combines these checks into a single pass/fail report.

Is import dlt still supported in Spark Declarative Pipelines?▼

No, import dlt is a deprecated API and should never be used. The modern approach is from pyspark import pipelines as dp, which provides the same table and expectation decorators for Lakeflow/SDP pipelines.

How do I reconcile source and target tables after a data load?▼

Run a UNION ALL query that computes COUNT(*) and SUM of key measures on both the staging source and the final destination table. Mismatched counts or sums indicate rows lost, duplicated, or altered during the load.

What is the difference between dp.expect and dp.expect_or_drop?▼

dp.expect only tracks violations as metrics while keeping all rows, whereas dp.expect_or_drop removes rows that fail the constraint. Use expect_or_drop when invalid records must not reach the target table, or ON VIOLATION FAIL UPDATE in SQL to stop the pipeline.