Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file not shown.
10 changes: 3 additions & 7 deletions docs/components/general-props/warning.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
<!-- SPACING-WARNING --start -->
!!! info
Visual warnings for spacing issues are available across all forms where values are entered.
When a value includes leading or trailing spaces, the system automatically highlights it inside a warning-colored chip and displays a tooltip message indicating the issue in real time — for example:
The **List** input flags entries with leading or trailing whitespace. A clean value like `ship` renders as a normal chip; values like ` ship` or `ship ` get a yellow chip background so the extra space stands out at a glance. A warning icon also appears next to the field title. Hover the icon to see the full list of values with extra spaces.

> “The following value has leading or trailing spaces: ‘ship ’”

![warning](/assets/data-quality-checks/expected-values/warning.png)

<!-- SPACING-WARNING --end -->
The chip is still saved exactly as typed. Re-enter the value without the surrounding spaces if the engine is meant to match it literally, since the comparison is exact and does not trim.
Comment thread
RafaelOsiro marked this conversation as resolved.
<!-- SPACING-WARNING --end -->
114 changes: 0 additions & 114 deletions docs/data-quality-checks/expected-values-check.md

This file was deleted.

60 changes: 60 additions & 0 deletions docs/data-quality-checks/expected-values/api.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
# :material-api:{ .middle style="color: var(--q-brick)" } Expected Values Check API

The Expected Values check is created and managed through the standard Quality Checks API by setting `rule` to `expectedValues`, listing one field under `fields`, and providing the allowed vocabulary in `properties.list`.

!!! tip
For complete API documentation, including request and response schemas, visit the [API docs](https://demo.qualytics.io/api/docs){:target="_blank"}.

## Endpoints

| Method | Path | Purpose |
|:---|:---|:---|
| `POST` | `/api/quality-checks` | Create a new Expected Values check. |
| `GET` | `/api/quality-checks/{id}` | Retrieve an Expected Values check by ID. |
| `PUT` | `/api/quality-checks/{id}` | Update an existing Expected Values check. |
| `DELETE` | `/api/quality-checks/{id}` | Delete (or archive) an Expected Values check. |

**Permission**: Requires **Author** team permission (or above) for `POST`, `PUT`, and `DELETE`; **Reporter** team permission (or above) for `GET`.

## Payload Example

Create an Expected Values check on `o_orderstatus` with `POST /api/quality-checks`, showing every field accepted by the create endpoint:

```json
{
"description": "Order status must be O, F, or P",
"rule": "expectedValues",
"fields": ["o_orderstatus"],
"container_id": 145,
"coverage": 1,
"filter": null,
"properties": {"list": ["O", "F", "P"]},
"tags": ["enum", "orders"],
"additional_metadata": {"jira": "DATA-1101"},
"anomaly_message_field": null,
"template_id": null,
"status": "Active",
"owner_id": 7,
"default_anomaly_assignee_id": 18
}
```

## Field Notes

| Field | Required | Notes |
|:---|:---:|:---|
| `description` | Yes | Free-text description shown in the UI. |
| `rule` | Yes | Must be `"expectedValues"`. |
| `fields` | Yes | Array with exactly one field name. Expected Values is a single-field rule. |
| `container_id` | Yes | ID of the container (table or file) the check runs against. |
| `coverage` | No | Fractional value between `0` and `1`. `1` (default) emits Record Anomalies for each failing row; `< 1` rolls failures into a single Shape Anomaly when the failing fraction exceeds the threshold. |
| `filter` | No | Spark SQL `WHERE` expression. Applied **before** the value comparison, so only filtered rows are evaluated. Send `null` for no filter. |
| `properties.list` | Yes | Array of accepted values. The list type is inferred from its contents: all-numeric → numeric list; all-boolean → boolean list; otherwise string list. Match the list type to the field type to avoid every row failing on type coercion. |
| `properties.is_element_context` | No | Set to `true` to evaluate each element of an array field against the list (uses `array_forall`). Auto-enabled by the platform for `Array[String]` fields. Only string element lists are supported today. |
| `tags` | No | List of tag names applied to the check for filtering and organization. |
| `additional_metadata` | No | Free-form key-value pairs (typically links to catalog, tickets, governance records). |
| `anomaly_message_field` | No | Name of a source-record field whose value should be used as the anomaly message instead of the system-generated one. In the UI this corresponds to the **Custom Anomaly Description** toggle. Applies to Record Anomalies (coverage = 1); ignored for Shape Anomalies. |
| `template_id` | No | ID of a Check Template to associate the check with. `null` if not using a template. |
| `status` | No | `"Active"` (default) or `"Draft"`. Draft checks are not evaluated by Scans. |
| `owner_id` | No | ID of the user who owns the check. Defaults to the user creating the check when omitted. |
| `default_anomaly_assignee_id` | No | ID of the user automatically assigned to anomalies produced by the check. |
Loading
Loading