Skip to main content
Data Quality Cover
Datazone’s Data Quality feature lets you attach a Ruleset — a versioned, git-backed collection of rules — to a dataset. Each rule checks one thing (nulls, duplicates, freshness, a value range, a custom SQL condition, …) and rolls up into a per-ruleset and per-project quality score you can track over time.

Key Features

  • Git-backed - rulesets live in your project’s repository as YAML, the same way Flows, Actions, and Knowledge Objects do
  • Typed checks - missing values, duplicates, format/regex, value ranges, freshness, row count minimums, schema compliance, or fully custom SQL
  • Severity-weighted scoring - critical/high/medium/low rules contribute proportionally to the quality score out of the box
  • Custom scoring - a data_quality_config.yaml in your repository sets your own formulas, severity weights, dimension and dataset weights, and score target — see Custom Scoring
  • Failing-row samples and runnable SQL - see exactly which rows broke a rule, and run the check’s query in SQL Explorer
  • Multiple triggers - run automatically after every dataset load, on a cron schedule, or manually
  • AI-assisted authoring - Orion can propose rules for a dataset from a natural-language prompt
  • A shared Rule Library - reusable built-in and organization-defined rule templates you can drop into any ruleset
Rulesets currently target datasets only. view and knowledge_object are accepted by the YAML schema but are not yet resolvable — a ruleset on anything other than a dataset is skipped.

Key Concepts

The rest of this page documents the full git-backed model, including per-branch definitions and branch-aware preview. In the current UI, rulesets are only ever edited and evaluated on the main branch — there is no branch switcher yet, even though the API itself is branch-aware.

Configuration

A ruleset is declared as a rulesets: entry in your project’s config.yml, parallel to flows:, actions:, and objects::
config.yml
File paths only need to be unique within a project, so two projects can each have a ruleset at the same path. The referenced file holds the ruleset’s rules:
rulesets/customers_ruleset_ab12cd.yaml
A ruleset’s YAML must target the dataset the ruleset is for. Validate, preview, apply, and save all fail with The YAML must target dataset '<alias>', the one this ruleset is for. if entity_alias / entity_id points somewhere else.

Rule fields

Renaming a rule’s alias is treated as deleting the old rule and creating a new one — its evaluation history and sparkline reset.

Dimensions

A dimension groups rules by the kind of quality they measure, and is the unit custom scoring rolls up by. There are 11:
An unknown dimension is a validation error, and the message suggests the closest match — for example Unknown dimension "acurracy". Did you mean "accuracy"?. Older versions silently fell back to the check type’s default. A ruleset saved through the UI or API is rejected; one that arrives through a git push is skipped with only a log warning, so a ruleset with a mistyped dimension stops updating until it is fixed.

Check Types

Composite-key uniqueness

To check that a combination of columns is unique, give duplicate_count a columns list instead of column:
  • Use either column or columns, never both, and list at least two columns — use column for a single one.
  • columns is only valid on duplicate_count, and every listed column must exist on the dataset.
  • The metric is the number of surplus rows (total minus distinct combinations), not the number of rows inside duplicated groups.
freshness and row_count_minimum have no real notion of a “failed row” — failed_rows is always 0 and only the metric value is compared against the threshold. For duplicate_count and schema_compliance, failure is the exact value required (so failure: 0 fails any nonzero count); see Thresholds for how the other checks read it.

Thresholds

warning and failure are the highest value that still passes, so a metric sitting exactly on failure passes and failure: 0 means no failing rows are tolerated. The exceptions are duplicate_count and schema_compliance, which compare for equality against failure, and row_count_minimum, described next.
For row_count_minimum, the thresholds are minimums: the value is the lowest row count that passes, not the highest. failure: 1 fails a dataset with no rows. The built-in Minimum Row Count template uses this rule.
range_check is the one check type that needs an explicit between comparator with both bounds — anything else on a range_check rule fails validation:
A rule with no thresholds at all is valid but is reported as not_evaluated — useful while you’re still deciding on a boundary.

Rule Library

Datazone ships a set of built-in rule templates, and you can add your own project- or organization-scoped ones. A ruleset can reference a template instead of writing out check/thresholds:
Built-in templates include Not Null Check, Primary Key Uniqueness, Composite Key Uniqueness, Email Format, UK Post Code Format, Value Range, Daily Freshness SLA, Minimum Row Count, and Schema Compliance. The Add from Library action in the ruleset editor searches templates by column type and dimension and splices a ready-to-use YAML fragment into your rules. Composite Key Uniqueness is a multi-column template: it binds a columns list instead of a single column, and its inserted YAML tells you to replace the placeholders with the columns that together form the key.
Built-in templates are seeded once per environment. An environment created before Composite Key Uniqueness shipped does not get it automatically, so it may be missing from the library there — write the check inline with columns instead.

AI-Assisted Rule Proposals

The ruleset editor’s Generate with Orion action asks an AI agent to propose rules for the dataset you’re editing, from an optional free-text prompt and the rules you already have in the draft buffer. The agent starts from the first rows of the dataset, searches the Rule Library first (including multi-column templates), and only falls back to a custom SQL check when nothing in the library fits — every proposal is re-validated server-side before it’s returned, so you always get YAML that’s ready to save. Nothing is written until you review and accept the proposed entries. See Orion AI for more on how Datazone’s AI agents are grounded in your data.

Validate, Preview & Apply

Editing a ruleset follows the same git-backed flow as Flows and Knowledge Objects — nothing is evaluated or scored until it’s committed:
  1. Validate — parses the YAML and checks it against the dataset’s live schema; returns per-field issues without touching git.
  2. Preview — additionally diffs the resolved rules against what’s already committed on the target branch, returning to_create / to_update / to_remove (with field-level changes) so you can see exactly what applying will do.
  3. Apply — commits the YAML to the project repository (creating rulesets/<slug>_<hash>.yaml and registering it in config.yml on first save) and immediately materializes the ruleset and its rules — the same code path a repository sync would run.
Because apply is a real commit, ruleset writes are gated by the same write_repository branch permission used for every other project resource — see Policy → Branch Protection if main is protected in your project. Saving the scoring config is a commit to the default branch too, under the same permission.

Running Rulesets

A ruleset’s trigger controls when it runs: Every ruleset can also be run on demand from the UI (“Run Now”) or via the API. Each run evaluates every rule in the ruleset — there’s no single-rule run. Each rule’s result is one of: A run also produces a project-level aggregate alongside its ruleset-level result, rolling up every active ruleset in the project — this is what powers the project-wide Data Quality overview.

Issues & History

A quality issue is simply a rule whose latest cached result is warning or failed — issues aren’t a separate record, they’re derived live from every active ruleset’s most recent run (paused rulesets are excluded). They are ordered worst first — by severity (critical first), then failed before warning, then most recently evaluated — so paginated pages follow on in a stable order. The issues list supports the same filters=[field][$op]:value query syntax as other list endpoints, letting you scope to an entity, a project, or a specific ruleset. For a single rule, its result history across past runs is available as a time-ordered list — this is what drives the sparkline shown in the rule detail panel. Each point carries the run_id, so you can open the failing-row sample saved on any past run.

Failing Rows & Runnable SQL

A failed check tells you that something is wrong; the sample tells you what.

Failing-row samples

After each ruleset run, every rule that ended failed or warning gets a sample of its offending rows saved against that run:
  • Up to 100 rows, with all columns of the dataset. Cells longer than 2,000 characters are cut with an ellipsis.
  • The sample is capped at 15 MiB; rows are dropped from the end to fit, and the sample is flagged as truncated.
  • The newest 10 samples per rule are kept; older ones are deleted. There is no time-based expiry, and deleting a ruleset deletes its samples.
  • A sample is a snapshot — it does not change if the data is fixed later. Passing runs neither create nor prune samples, and a rule’s last-failed run and time are carried forward across later passing runs.
What gets sampled depends on the check: Read a sample with GET /ruleset/get-failed-rows/{run_id}/{rule_id} (rule_id is the rule’s alias). The response includes kind (failing_rows or query_result), columns, rows, rows_scanned, failed_rows, captured_at, rows_truncated, and the query that produced it. It requires ruleset:read and dataset:read on the ruleset’s dataset — you can’t read a dataset’s rows through a sample you couldn’t read directly.

Runnable SQL

GET /ruleset/get-preview-sql/{ruleset_id}/{rule_id} returns the SQL a rule runs, in two forms: In the rule drawer, Run in SQL Explorer opens the runnable query in a new SQL Explorer tab.

Quality Score

With no scoring config, the quality score is a severity-weighted pass rate, pooled across every rule:
  • Each rule’s severity contributes a weight: critical=5, high=3, medium=2, low=1
  • Each result contributes a factor: passed=1, warning=0.5, failed=0
  • error, no_data, and not_evaluated results are excluded entirely from the calculation
  • score = round(sum(weight × factor) / sum(weight) × 100), or 0 if nothing was scored
Scores are computed at ruleset, dataset, and project scope on every run, along with a score per dimension. A daily snapshot is kept for history — score-history endpoints return one point per calendar day over a range (default: the last 30 days), with null for days that had no run, so a chart can show a real gap instead of a false zero. A dataset’s history is the pooled score across all of its active rulesets, not an average of their scores. A live summary (current score, result counts, active/evaluated rule counts, coverage percent, per-dimension scores, and the score target) is also available without waiting for history to catch up. Want different weights, your own formula per dimension, or a different target? That’s Custom Scoring.

Custom Scoring

Add a data_quality_config.yaml to the root of your project repository and Datazone scores every run with your rules instead of the built-in pass rate. You can set:
  • the score target a healthy project should reach
  • a formula that turns each rule’s result into a 0–100 rule score — globally, per dimension, per ruleset, or per rule
  • severity weights — how much a rule counts inside its dimension
  • dimension weights — how much each dimension counts in the project score
  • dataset weights — how much each dataset’s rules count
data_quality_config.yaml

How the file is loaded

  • Fixed location. The file lives at the repository root and is not registered in config.yml.
  • Default branch only. It is read from the default branch; a copy on any other branch is never used for scoring.
  • No file, no config. A missing file means the built-in score. Deleting the file clears the config.
  • Every dataset alias must exist. Each key under datasets: must be the alias of a dataset in this project, or the whole file is rejected.
  • Unknown keys are rejected at every level, so a typo can’t silently do nothing.
If you push an invalid data_quality_config.yaml through git, Datazone keeps using the previously saved config and only logs a warning — nothing is shown in the app. Saving through the UI or API is safer, because it rejects an invalid file with line numbers instead.

Keys

A severity left out of a severity_weights map takes its built-in weight (5/3/2/1) — not the value from a lower level.

Formulas

A formula turns one rule’s result into a rule score from 0 to 100. It is a small expression — numbers, the variables below, and a few functions — checked against a whitelist when you save. It is never evaluated as arbitrary code. You can use + - * /, comparisons (== != < <= > >=), and / or / not, a if cond else b, parentheses, and the functions min, max, abs, and round. Formulas are limited to 500 characters, and a bare number in YAML isn’t a string, so quote your formulas.
  • The score is clamped to 0–100.
  • Powers, modulo, attribute access, lambdas, lists, strings, and any function other than the four above are rejected when you save, and an unknown variable is rejected with a suggestion — Unknown variable "rows_scaned". Did you mean "rows_scanned"?
  • If a formula can’t be evaluated for a rule — division by zero, a variable with no value such as failure_threshold on a rule with no threshold, or a non-finite result — that rule is left out of the score. It isn’t counted as 0, and the score as a whole doesn’t fail.
  • Saving checks syntax and variable names only, not the number of arguments: min(failed_rows) saves, then skips every rule that uses it.
Freshness, row-count, and schema checks still report rows_scanned and failed_rows (for freshness, failed_rows is always 0), so a pass-rate formula such as 100 * passed_rows / rows_scanned scores a stale freshness rule 100. Give the dimension that holds freshness rules a result-based formula — 100 * result_factor — as the built-in templates do for timeliness.

Dimensions and includes

Rules are scored under their dimension, and each dimension is scored as the weighted mean of its rules. Dimensions you don’t list still count, with the defaults and weight 1. includes folds other dimensions into one: with timeliness: {includes: [freshness]}, every freshness rule is scored as timeliness — using timeliness’s formula, severity weights, and weight — and only timeliness appears in the breakdown. A dimension can’t include itself, can’t include a dimension that is listed as its own key, and can be included by only one other.

Overrides in a ruleset

A ruleset file can override the project config for its own rules:
rulesets/orders_ruleset_ab12cd.yaml
  • Ruleset scoring accepts formula and severity_weights. Rule scoring accepts formula only.
  • Overrides apply even when the project has no scoring config.
  • Formula errors are reported with their location, e.g. rules.amount_positive.scoring.formula: Unknown variable "bogus"., on validate, preview, and save.
  • The scoring: blocks are YAML-only — the editor has no form for them.
The top level of a ruleset file doesn’t reject unknown keys, so a typo such as scorring: is silently ignored. A typo inside a scoring: block is rejected.

How a score is computed

For each rule, Datazone picks the first setting that is defined: Then:
  1. A rule that ended error or no_data is never scored. not_evaluated is left out under the built-in formula, but a formula that doesn’t use result_factor — a row-count formula, for example — can still score it.
  2. The rule’s weight is its severity weight multiplied by its dataset’s weight.
  3. Each dimension’s score is the weighted mean of its rule scores, to one decimal. A dimension with no scoreable rules is absent.
  4. The project score is the mean of the dimension scores weighted by each dimension’s weight, rounded to a whole number.
Without a config there are no dimension or dataset weights: every rule is pooled into one weighted mean, exactly as in the built-in score. The same calculation runs at every level — ruleset, dataset, and project — each over the rules in that scope. A higher-level score is recomputed from the rules, not averaged from the scores below it.

Worked example

A project with two datasets, orders and customers, scored with this config:
data_quality_config.yaml
orders has two rulesets and customers has one. The latest run produced these results: Each rule’s weight is its severity weight multiplied by its dataset’s weight. Then, level by level: 1. Rules → dimensions, inside a ruleset. Each dimension is the weighted mean of its rules. 2. Dimensions → ruleset score. The dimension scores are averaged, weighted by each dimension’s weight (completeness 2, uniqueness 1, timeliness 1), and rounded. 3. Rulesets → dataset. A dataset’s score pools all the rules of all its rulesets, then goes through the same dimension roll-up. For orders, the completeness, uniqueness, and timeliness scores are 85.7, 0.0, and 100.0, so the score is (85.7×2 + 0.0×1 + 100.0×1) / 4 = 68. customers has one ruleset, so its dataset score is the same 78. 4. Datasets → project. The project pools every rule in the project, and this is where dataset weights matter — each rule’s weight already carries its dataset’s weight, so orders pulls harder inside each dimension: Project score = (83.3×2 + 16.7×1 + 100.0×1) / 4 = 71. That is below the target of 80. A few things this example shows:
  • The project score isn’t the average of its datasets. The dataset scores are 68 and 78, an average of 73 — but the project is 71, because the failed order_id_unique rule (weight 15) outweighs the passing customer_id_unique rule (weight 3) inside uniqueness.
  • Dataset weights shift where the pain shows up. Uniqueness comes out at 16.7 for the project. With equal dataset weights it would be 37.5 (3 of 8 weight passing), because orders counts three times as much as customers.
  • includes folds dimensions together. loaded_today is a freshness rule, but it shows up under timeliness, with timeliness’s formula and weight.
  • The built-in score would say 67. With no config, the same results pool into one mean with no dimension or dataset weights: 14 earned of 21 total weight = 67.
Adopting the Datazone default template uses the same formula and weights as the built-in score, but the roll-up changes from one pooled mean to a dimension-weighted one, so the numbers can differ.
Each run records the per-rule score, weight, and formula source (rule, ruleset, dimension, defaults, or builtin), the per-dimension scores, and a hash of the config that produced it. When the config changes, only today’s project and dataset snapshots are re-scored, and only where history already exists. Older runs and snapshots keep the score they were computed with, so a score-history chart can mix points from old and new formulas. The live quality summary always reflects the current config.

Templates

Seven starting points are built in, available from Start from template on the Scoring tab or the templates endpoint:

Saving the config

Edit it on the Scoring tab of a project’s Data Quality page, or in git. The tab offers a form (Dimension view) and a YAML editor, and a live preview shows the project score before and after your edit — per dimension and per dataset — scored against every active rule’s latest result. The form rewrites the file, so comments in it aren’t kept. PUT is a real commit, so branch protection and the write_repository permission apply as for any other project file. An invalid file is rejected with HTTP 400 and detail.issues, each with a message, line, and column, and nothing is committed. There is no DELETE and an empty body is invalid — to remove the config, delete the file in git.

Authorization

Data Quality introduces two new project-scoped resource types alongside the ones described in Policy: Both follow the standard project hierarchy (project:<id>:ruleset:*, project:<id>:ruleset:<id>), so you can grant Data Quality access the same way you’d grant access to datasets or flows. A few operations need more than the ruleset permission:

Where to Find It

Data Quality has two entry points in the app:
  • Project → Catalog → Data Quality — rulesets and issues across every dataset in the project, with Overview / Rulesets / Issues / Scoring tabs. The Scoring tab is where you edit the scoring config. “Add ruleset” here asks you to pick the dataset first, so you can create a ruleset without opening the dataset
  • Dataset → Data Quality — scoped to a single dataset, with Overview / Rulesets / Issues tabs, “Run all”, and “Add ruleset”. Scoring is project-level, so there is no Scoring tab here
Rules are edited YAML-first — there’s no per-check-type form. The editor is a YAML pane with column-name autocomplete next to a read-only, parsed view of the same rules, plus Add from Library, Generate with Orion, Validate, and Preview actions before you save. Opening a rule shows its check configuration (with the columns of a composite key), current metric, threshold, the metric and failing-rows SQL with Run in SQL Explorer, a history bar per run, and the failing rows saved on a failed or warning run.

Policy

Grant access to rulesets and rule templates

Projects

How git-backed project resources are structured and synced

Flows

Another git-backed, YAML-defined project resource

Orion AI

How Datazone’s AI agents are grounded in your data