> ## Documentation Index
> Fetch the complete documentation index at: https://docs.zwiron.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Data Quality Tests

> Define automated quality rules on tables and columns — alert when nulls, uniqueness, ranges, or SQL checks fail.

**Data Quality tests** are rules you attach to tables or individual columns. Zwiron runs them against your live data through the agent and records whether each rule passed, failed, or could not execute. Tests can be run on demand or on a schedule.

***

## Concepts

| Term               | Definition                                                      |
| ------------------ | --------------------------------------------------------------- |
| **Test case**      | A single quality rule attached to one table or column           |
| **Test type**      | The kind of check — e.g. "no null values", "row count in range" |
| **Test result**    | The outcome of a single run — `passed`, `failed`, or `aborted`  |
| **Severity**       | How critical a failure is: `critical`, `warning`, or `info`     |
| **Asset coverage** | Whether a table has at least one active test case               |

***

## Navigating Data Quality

Go to **Data Quality** in the sidebar. The page shows all test cases grouped by table.

**Summary cards** at the top show counts across all tests:

| Card        | Description                                                    |
| ----------- | -------------------------------------------------------------- |
| **Passed**  | Tests that ran and passed on the last execution                |
| **Failed**  | Tests that detected a rule violation                           |
| **Aborted** | Tests that could not execute (connection error, timeout, etc.) |
| **Not run** | Tests that have never been executed                            |

**Tab filters:**

* **All** — every table with at least one test
* **Issues** — tables where one or more tests failed
* **Success** — tables where all tests passed
* **Uncovered** — tables in the catalog with zero test cases

***

## Creating a test case

1. Click **New Test** (top-right of the Data Quality page)
2. Select a **table** — browse connections, schemas, and tables
3. Select a **test type**
4. Fill in the **parameters** for that test type (see [Test types](#test-types) below)
5. Set a **severity** level
6. Optionally set a **display name** and **description**
7. Click **Create**

The test case is created in a disabled-by-default state for some types, or enabled immediately — check the toggle after creation.

***

## Test types

### Table-level tests

Apply to the whole table. No column selection needed.

| Type                               | What it checks                                                       |
| ---------------------------------- | -------------------------------------------------------------------- |
| `tableRowCountToEqual`             | Table must have exactly N rows                                       |
| `tableRowCountToBeBetween`         | Row count must be within `[min, max]`                                |
| `tableColumnCountToEqual`          | Table must have exactly N columns                                    |
| `tableColumnCountToBeBetween`      | Column count must be within `[min, max]`                             |
| `tableColumnNameToExist`           | A specific column name must be present                               |
| `tableColumnToMatchSet`            | Column names must exactly match a provided set                       |
| `tableCustomSQLQuery`              | A SQL query must return zero rows — use for any business-logic check |
| `tableRowInsertedCountToBeBetween` | Rows inserted since the last run must be within `[min, max]`         |
| `tableDataToBeFresh`               | The most recent row must be newer than a defined time window         |

### Column-level tests

Apply to a single column. Select the column after selecting the table.

| Type                            | What it checks                                        |
| ------------------------------- | ----------------------------------------------------- |
| `columnValuesToBeNotNull`       | No NULL values allowed                                |
| `columnValuesToBeUnique`        | All values must be distinct                           |
| `columnValuesToBeBetween`       | All values must be within `[min, max]`                |
| `columnValuesToBeInSet`         | All values must appear in a provided list             |
| `columnValuesToBeNotInSet`      | No value may appear in a provided list                |
| `columnValuesToMatchRegex`      | All values must match a regular expression            |
| `columnValuesToNotMatchRegex`   | No value may match a regular expression               |
| `columnValueLengthsToBeBetween` | String length must be within `[min, max]`             |
| `columnValueMaxToBeBetween`     | Column max must be within `[min, max]`                |
| `columnValueMinToBeBetween`     | Column min must be within `[min, max]`                |
| `columnValueMeanToBeBetween`    | Column average must be within `[min, max]`            |
| `columnValueMedianToBeBetween`  | Column median must be within `[min, max]`             |
| `columnValueStdDevToBeBetween`  | Standard deviation must be within `[min, max]`        |
| `columnValuesSumToBeBetween`    | Column sum must be within `[min, max]`                |
| `columnValuesMissingCount`      | Number of NULL/empty values must be below a threshold |

***

## Severity levels

Severity does not affect whether a test passes or fails — it determines how failures are prioritized in the UI.

| Severity   | Usage                                              |
| ---------- | -------------------------------------------------- |
| `critical` | Failures indicate a serious data integrity issue   |
| `warning`  | Failures should be investigated but are not urgent |
| `info`     | Tracking a metric; failures are informational only |

***

## Running tests

### Run all tests for a table

On the Data Quality page, click the **Run** button next to a table name. All enabled test cases for that table execute immediately.

### Run all tests

Click **Run All** (top-right) to execute every enabled test case across every table.

### Results

Results appear inline as tests complete. Each test shows its latest outcome:

| Outcome      | Meaning                                              |
| ------------ | ---------------------------------------------------- |
| ✅ `passed`   | The rule held — data is within expected bounds       |
| ❌ `failed`   | The rule was violated — details show what went wrong |
| ⚠️ `aborted` | The test could not run — check connection health     |

***

## Asset detail page

Click any table in the Data Quality list to see:

* A pass/fail/aborted summary for that table
* Every test case with its last result and timestamp
* A results history table for each test case (click to expand)

***

## Editing a test case

Click the pencil icon on any test case to update:

* Parameters (e.g. change the allowed row count range)
* Severity
* Display name and description
* Enabled / disabled toggle

Disabled tests are retained but skipped during runs.

***

## Deleting a test case

Click the trash icon on any test case. Deletion is immediate and cannot be undone.

***

## Data Quality tab on pipelines

Every pipeline (job) has a **Data Quality** tab that shows quality test results for the tables that pipeline writes to. See [Validation](/pipelines/validation) for the full accuracy report available at the pipeline level.

***

## Related

* [Data Catalog](/platform/catalog) — the asset inventory that test cases attach to
* [Validation](/pipelines/validation) — pipeline-level accuracy reports and semantic rules
* [Notifications](/platform/notifications) — configure alerts when tests fail
