Data quality
Data quality is the degree to which data is accurate, complete, consistent, timely, and fit for the purposes it's used for—dashboards, models, and operational decisions.
Overview
Data quality describes whether data can be trusted for its intended use. It's usually broken down into several concrete dimensions:
- Accuracy — does the data correctly reflect reality?
- Completeness — are required fields and records missing?
- Consistency — do the same facts agree across tables and systems?
- Timeliness / freshness — is the data current enough to be useful?
- Uniqueness — are there unintended duplicate records?
- Validity — does data conform to expected formats, types, and ranges?
Poor data quality is expensive precisely because it's often invisible until it causes a bad decision—a dashboard with silently duplicated rows overstates revenue, a null-heavy join undercounts customers, and nobody notices until finance asks why the numbers don't reconcile.
How data quality is enforced
Most teams enforce data quality with two complementary approaches: automated tests that run as part of the pipeline, and profiling/monitoring that surfaces anomalies over time.
Testing checks specific, known rules—dbt's built-in and custom tests are a common example:
Copy code
models:
- name: orders
columns:
- name: order_id
tests:
- unique
- not_null
- name: amount
tests:
- not_null
Profiling looks at the actual shape of the data to catch problems you didn't think to test for—unexpected nulls, a min/max outside a sane range, or a cardinality that suddenly changed.
Profiling with DuckDB
DuckDB's SUMMARIZE command gives an instant profile of a table's columns—type, min, max, approximate unique count, average, standard deviation, quantiles, and null percentage—without writing any custom SQL:
Copy code
SUMMARIZE SELECT * FROM orders;
This is a fast first check for the kinds of quality issues that plain row counts miss, like a column that's unexpectedly 40% null or an amount column with a suspicious negative minimum:
Copy code
SELECT count(*) AS total_rows,
count(*) FILTER (WHERE amount IS NULL) AS null_amounts,
count(*) FILTER (WHERE amount < 0) AS negative_amounts
FROM orders;
Where it fits with governance and observability
Data quality overlaps with, but isn't identical to, data governance (policy and ownership) and data observability (automated, ongoing monitoring of pipeline health). Quality is the property being managed; governance and observability are the processes and tooling that manage it.
Related terms
Data profiling is the process of examining a dataset to understand its structure, content, and quality — things like data types, value distributions, null rates, and cardinality — before using it for analysis or building pipelines on top of it.
Data observability →Data observability is the continuous, automated monitoring of data pipelines and datasets to detect freshness, volume, schema, and quality problems before they reach downstream users.
Data governance →Data governance is the set of policies, roles, and processes an organization uses to manage the availability, quality, security, and proper use of its data.
Data freshness →Data freshness measures how up to date a dataset is relative to when the underlying real-world events actually occurred, and is a core signal for whether downstream data and dashboards can be trusted.
Great Expectations →Great Expectations (GX) is an open-source Python framework for defining, running, and documenting automated data quality checks called Expectations.
Data contract →A data contract is a formal, agreed-upon specification between a data producer and its consumers that defines the schema, format, semantics, and guarantees (like update frequency or backward-compatibility rules) of a dataset.
FAQS
Data quality is the outcome—accurate, complete, consistent data. Data observability is the practice of continuously monitoring pipelines and datasets to detect quality problems automatically, often before anyone downstream notices.
By defining explicit rules (uniqueness, non-null constraints, referential integrity, value ranges) and testing data against them, combined with profiling to catch anomalies you didn't anticipate. Tracking test pass/fail rates over time turns quality into something measurable rather than a vague impression.
Yes—tools like dbt tests, Great Expectations, and Soda run rule-based checks as part of a pipeline, failing the run or alerting when a check fails, so quality issues are caught before bad data reaches downstream consumers.
