
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/lowrules contribute proportionally to the quality score out of the box - Custom scoring - a
data_quality_config.yamlin 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
Configuration
A ruleset is declared as arulesets: entry in your project’s config.yml, parallel to flows:, actions:, and objects::
config.yml
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
Dimensions
A dimension groups rules by the kind of quality they measure, and is the unit custom scoring rolls up by. There are 11:Check Types
Composite-key uniqueness
To check that a combination of columns is unique, giveduplicate_count a columns list instead of column:
- Use either
columnorcolumns, never both, and list at least two columns — usecolumnfor a single one. columnsis only valid onduplicate_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:
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 outcheck/thresholds:
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:- Validate — parses the YAML and checks it against the dataset’s live schema; returns per-field issues without touching git.
- 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. - Apply — commits the YAML to the project repository (creating
rulesets/<slug>_<hash>.yamland registering it inconfig.ymlon 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’strigger 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 iswarning 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 endedfailed 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.
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, andnot_evaluatedresults are excluded entirely from the calculationscore = round(sum(weight × factor) / sum(weight) × 100), or0if nothing was scored
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 adata_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.
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_thresholdon 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.
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
scoringacceptsformulaandseverity_weights. Rulescoringacceptsformulaonly. - 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:
- A rule that ended
errororno_datais never scored.not_evaluatedis left out under the built-in formula, but a formula that doesn’t useresult_factor— a row-count formula, for example — can still score it. - The rule’s weight is its severity weight multiplied by its dataset’s weight.
- Each dimension’s score is the weighted mean of its rule scores, to one decimal. A dimension with no scoreable rules is absent.
- The project score is the mean of the dimension scores weighted by each dimension’s
weight, rounded to a whole number.
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_uniquerule (weight 15) outweighs the passingcustomer_id_uniquerule (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
orderscounts three times as much ascustomers. includesfolds dimensions together.loaded_todayis afreshnessrule, 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.
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
Related Resources
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