Updates an existing quality rule with the provided details. Returns a status message.
Request
Request body properties
| Ancestors | Property | Required | Type | Description |
|---|---|---|---|---|
| id | Yes | string | ||
| name | No | string | The unique identifier for the rule. This value is used to reference the rule within the system. |
|
| description | No | string | A human-readable explanation describing the rule's purpose or intent. | |
| dimensionName | No | string | Specifies the data quality dimension that the rule addresses. The following values can be provided:
|
|
| passCondition | No | string | Defines the specific criteria or thresholds a data element must meet to be considered acceptable:
|
|
| passCondition | type | No | string |
The config type. This is either Note: We currently only support the
script type. |
| passCondition | config | No | string | The expression that defines whether a data element is considered successful. In the expression, use the operators described in Table 2. |
| filterCondition | No | string |
An expression used to filter records in a dataset, ensuring only accurate, complete, and relevant data is used for analysis. |
|
| filterCondition | type | No | string |
The config type. This is either
"script" or "SQL". In the expression, use the operators described in Table 2.Note: We currently only support the
script type. |
| filterCondition | config | No | string | The expression that defines whether a data element is returned by the method. In the expression, use the operators described in Table 2 |
| captureFailedRecords | No | boolean |
Set this property to |
|
| enableAutoRun | No | boolean |
Set this property to |
|
| targetingType | No | string |
Specifies the type of asset the rule targets. The following values can be provided:
|
|
| targetAssetsFilter | No | array[string] |
This targets assets. Specify an array of filter strings that define which assets the rule applies to (such as datasets, fields, or data sources). Each filter uses a domain-specific syntax, for example: This property uses operators described in Table 1.
|
|
| mappings | No | array[object] |
An array of mapping objects that define how columns from the selected assets are mapped for rule evaluation. Mappings can be applied if targetingType is set to |
|
| mappings | datasetId | No | string |
A dataset identifier. |
| mappings | columnMapping | No | array[object] |
An array of objects defining how source columns are mapped to target fields. Each object includes:
|
| mappings/columnMapping | columnName | No | string |
Name of the source column. |
| mappings/columnMapping | dataType | No | string |
Data type of the column (for example, string, integer) |
| mappings/columnMapping | alias | No | string |
Alias for the column, used in expressions. |
Request body property operators
Tables in this section describe operators to be used in specified request body property values.
targetingType value |
Catalog type | Filter | Operators |
|---|---|---|---|
Field |
Field |
|
|
Dataset |
Dataset |
|
|
FilterByCondition |
Datasource | filter = name |
|
| Datasource | filter = name |
|
|
| Dataset | filter = id |
|
|
| Dataset | filter = value |
|
|
| Semantic type | filter = qualifier |
|
|
| Semantic type | filter = value |
|
| For this operation | Use this operator |
|---|---|
| is | = |
| is not | != |
| is populated | IS NOT NULL |
| is not populated | IS NULL |
| Value in the array values | IN |
| is greater than | >= |
| is greater than or equal to | >= |
| is less than | <= |
| is less than or equals to | <= |
| Date | TO_DATE('YYYY-MM-DD'), for example TO_DATE('1990-12-07') |
| Time | TO_TIME('HH:MI:SS'), for example TO_TIME('11:25:31') |
| Date-time | TO_DATETIME('YYYY-MM-DD HH:MI:SS'), for example TO_DATETIME('1990-12-07 11:25:31') |
Request example
Example request body for this method is shown below.
{
"id": "rule_id",
"name": "rule_name",
"description": "rule_description",
"dimensionName": "dimension_name",
"passCondition": {
"type": "script",
"config": "condition_expression"
},
"captureFailedRecords": true,
"enableAutoRun": true,
"targetingType": "Dataset",
"targetAssetsFilter": [
"properties.CatalogType:eq(Dataset)&filter=id:eq(asset_id)"
],
"mappings": [
{
"datasetId": "dataset_id",
"columnMapping": [
{
"columnName": "column_name",
"dataType": "string",
"alias": "column_alias"
}
]
}
]
}Response
The method returns 200 if the rule is updated successfully.
Response example
Example status code responses for this method are shown here.
Rule updated successfully.
{
"id": "694b9c09fdf9159bd458aaa1"
}{
"type": "about:blank",
"title": "Bad Request",
"status": 400,
"detail": "Rule must have an id present for update",
"instance": "/v1/quality/rules",
"errorCode": "DIS-QUALITY-Rule-USR-1005"
}{
"type": "about:blank",
"title": "Not Found",
"status": 404,
"detail": "Rule not found",
"instance": "/v1/quality/rules",
"errorCode": "DIS-QUALITY-Rule-USR-1001"
}{
"type": "about:blank",
"title": "Internal Server Error",
"status": 500,
"detail": "An unexpected error occurred on the server",
"instance": "/v1/quality/rules",
"errorCode": "DIS-QUALITY-RULES-SVC-0001"
}