Skip to main content

Quality Checks

Quality checks are the building blocks of data quality monitoring. They define what to validate, how to validate it, and what constitutes a failure.

Creating a Quality Check

From the Quality Module

In the sidebar, navigate to Quality, click Create Check, fill in the check configuration, and save to create the check.

From a Product

Alternatively, open a data product, go to the Quality tab, and click Add Quality Check. The product is automatically associated using this method.

Inline Creation

Creating checks from a product's Quality tab automatically links the check to that product, saving you a step.

Check Configuration

Basic Information

Each check is defined by a Name (a descriptive identifier) and a Description explaining what it validates. You also define the Check Type (the validation logic) and assign a Severity level (Warning, Error, or Critical).

Target Association

You can associate a check with one or more Products to validate. The check will run once, but the results are associated with all selected products. Optionally, you can specify a Field within a product (e.g., user_id) to target the validation more precisely.

Multi-Product Checks

A single check can be associated with multiple products simultaneously. This offers Efficiency by defining logic once (e.g., "Revenue is positive") and applying it to multiple tables like monthly_revenue, daily_revenue, and forecast_revenue. If the check fails, the Scoring impact affects the Quality Score of all associated products. Additionally, the check gains Visibility on the Quality tab of every associated product.

Check Types

SQL Metric checks return a single numeric value from a query, which is then compared against warning and critical Thresholds. SQL Condition checks assert a boolean condition or count (e.g., verifying that the count of non-conforming rows is zero) based on an Expected pass/fail logic.

Field Checks allow you to run multiple validations on a list of Fields within a single check. You can apply rules like null checks, uniqueness, type validation, range constraints, pattern matching, enum validation, or length checks. Results are reported per-field, grouped by batch_id.

Reconciliation checks compare values between a Source Query and a Target Query, allowing for a defined Tolerance of acceptable difference. Null Checks validate that a field meets a maximum acceptable null percentage Threshold (0-100%). Range Checks ensure numeric values fall within a specified Min and Max Value range. Uniqueness Checks validate that a specific Field contains no duplicates.

Freshness Checks validate that data was updated within a specific timeframe, comparing the Max Age (in hours) against a designated Timestamp Field. Finally, Custom / Manual checks allow for external metrics pushed via API or manual values entered directly in the UI.

Query Parameters

SQL-based checks support dynamic parametrization using {{param_name}} syntax. This allows you to write generic SQL queries and inject values at runtime or use defaults.

Defining Parameters

Parameters have specific properties: Name (the placeholder name), Type (data type like Text or Number), Default (fallback value), and Required (which blocks execution if no value is present).

Example Query:

SELECT count(*) 
FROM transactions
WHERE transaction_date >= '{{start_date}}'
AND amount > {{min_amount}}

Runtime Overrides

When triggering a check (via API or UI), you can supply values for these parameters.

Reusable Checks

Parameters enable Environment-Agnostic Checks. Define a {{target_schema}} parameter and override it to validate staging vs prod data with the exact same check definition.

Schedule Configuration

Checks can be configured with an Enabled status (determining if it runs automatically) and a Schedule (a cron expression for timing).

Running Checks

Manual Execution

Run a check on-demand by opening the check detail page, clicking Run Now, waiting for execution to complete, and then viewing the result.

Scheduled Execution

Checks run automatically based on their schedule. Results appear in the execution history, failed checks trigger alerts, and no manual intervention is required.

Execution Results

Each run produces a Status (Pass, Fail, Warning, Error), an Actual Value (the measured metric), an Execution Message (details about the result), and a Timestamp. For field checks, Execution Details provide per-field results, Batch ID groups sub-executions, and Field Name identifies the target column. You can also flag runs as Is Ignored.

Viewing Check Details

Check Detail Page

Navigate to a check to see the current configuration and parameters, recent execution history, pass/fail trends, and all associated products.

Execution History

The history tab shows a chronological list of all runs with status indicators. You can expand details for each run and filter by status or date.

Managing Checks

Editing a Check

Open the check detail page, click Edit, modify the configuration as needed, and save your changes.

Duplicating a Check

To create a similar check, open an existing check, click Duplicate (if available), modify the copy, and save it as a new check.

Disabling a Check

To temporarily stop a check from running, edit the check, toggle Enabled to off, and save. The check won't run on schedule but remains in the system.

Deleting a Check

To permanently remove a check, open the check detail page, click Delete, and confirm the action.

warning

Deleting a check removes all its execution history. Consider disabling instead if you want to preserve historical data.

Check Governance

For regulated environments, check modifications may require approval.

Change Requests

When governance is enabled, propose a change to the check and submit it for review. A steward reviews and approves or rejects the change; approved changes are applied automatically.

Audit Trail

All check changes are logged, detailing who made the change, what was modified, and when it occurred.

Viewing Product Quality

Quality Tab

In a product's detail view, the Quality tab shows all checks associated with this product, the current status of each, a trend chart with daily pass/fail counts, and quick actions to run or create checks.

This chart provides a visual representation of quality over time. Green bars indicate passing executions, while Red bars show failing executions. Hover for daily details or scroll for a historical view.

External Integration

Quality checks can be managed via the Qarion Python SDK (recommended) or the slug-based API endpoints.

Using Python SDK

from qarion import QarionClient

async with QarionClient() as client:
# Trigger a check
await client.quality.trigger("my-space", "my-check")

# Push external results
await client.quality.push_result(
"my-space", "my-check",
status="pass",
value=100.0
)

Triggering Checks Externally

Use the slug-based trigger endpoint to run checks from scripts or pipelines: POST /s/{space_slug}/quality/{check_slug}/run. Supply optional parameter overrides in the request body.

Pushing Results

Push execution results from external systems (dbt tests, Airflow tasks) using: POST /s/{space_slug}/quality/{check_slug}/push. The result is recorded as a new execution and triggers alerting if thresholds are breached.

Querying by Slug

Retrieve check definitions and execution history using human-readable slugs via GET /s/{space_slug}/quality/{check_slug} and GET /s/{space_slug}/quality/{check_slug}/executions.

Troubleshooting

Check Always Fails

If a check consistently fails, review the check configuration to verify thresholds are realistic. Check if the data source is accessible and review the error message for clues.

Check Not Running

If scheduled checks aren't executing, verify the check is enabled and the schedule is configured. Check system connectivity to data sources and review system logs for errors.

Unexpected Results

If results don't match expectations, run the check manually to reproduce the issue. Verify the check logic matches your intent, check for data source changes, and review execution messages for details.

Best Practices

Start Simple

Begin with basic null and freshness checks. These are easy to configure and offer high value for catching common issues, allowing you to build complexity over time.

Cover Critical Data

Prioritize checks for frequently used products, data feeding important reports, and fields with business-critical constraints.

Set Realistic Thresholds

Avoid checks that always fail. Analyze current data quality first, set thresholds slightly above the current state, and tighten them over time as quality improves.

Review Regularly

Periodically audit your checks to remove obsolete ones, update thresholds as needs change, and add checks for newly discovered issues.