Configure data quality rules SKILL
You can use natural language commands to instruct code agents like Qoder and CodeX to manage the entire lifecycle of data quality rules. This process includes creating monitoring objects, configuring check rules, setting up scheduling and alarms, and performing test runs.
Feature overview
The data quality rules SKILL allows you to use natural language commands to configure data quality rules for monitoring objects such as Dataphin tables, global tables, data sources, and metrics. You can also manage scheduling, alarms, test runs, rule activation and deactivation, and view results, enabling you to promptly identify and resolve data quality issues. Supported check dimensions include completeness (not-null), uniqueness, validity (format, value range, enum), consistency, and stability (fluctuation).
Use cases:
-
Configure data quality checks, such as not-null, uniqueness, value range, enum, and format checks, for fields in a table.
-
Set up scheduled or data-update-triggered execution for data quality rules, and configure alarms to notify the quality owner when a check fails.
-
Perform a test run to validate a rule's effectiveness before activating it.
-
View the execution results and history of data quality rules.
Limitations: You cannot use this SKILL to customize settings for exception archiving mode, archive location, scoring method, or scoring weight. To adjust these settings, use the Dataphin UI. Alarms are configured at the monitoring object level and apply to all data quality rules for that object; they cannot be set for individual rules. Supported scheduling methods vary by monitoring object type. For example, data-update-triggered scheduling is not available for global tables or data sources. The agent will inform you of these constraints during configuration.
Prerequisites
-
Your account must have permission to manage data quality rules. Examples of such roles include Super Administrator, Quality Administrator, or a custom role with the necessary permissions.
-
You have the target tenant ID and information about the tables, fields, and other objects you want to monitor.
Examples
The following examples show commands you can copy and use directly:
-
Configure a not-null check for the
phonefield in theaccounttable of thesalesproject. Set it as a strong monitoring rule that passes when the number of abnormal records is 0. -
For the
accounttable, configure a uniqueness check on theemailfield. Schedule it to run daily at 2:00 AM and send an email notification to the quality owner if the check fails. -
Configure a value range check for the
amountfield in theorderstable, requiring the amount to be greater than 0. After configuration, perform a test run to verify its effectiveness. -
View the latest execution results for the
accounttable's data quality rules.
Interaction steps:
-
After you issue a configuration command, the agent first confirms the monitoring object type (such as Dataphin table, global table, data source, metric, or real-time metatable) and the specific object to monitor.
-
The agent automatically locates the monitoring object, matches it with a suitable data quality rule template, and populates the configuration—such as the check field and check conditions—based on your request.
-
If you do not specify them, the agent will ask whether you want to configure scheduling and alarms.
-
Before creating the rule, the agent typically summarizes the configuration details for you to confirm. This includes the monitoring object, check field, rule template, check conditions, rule severity, scheduling, and alarm settings.
-
After you confirm, the agent creates the rule and initiates a test run by default. The agent then reports the test run results back to you.
Execution results
After the rule is configured, you can expect the following outcomes:
-
Response: On successful creation, the system returns identifiers for the monitoring object, data quality rule, scheduling configuration, alarms, and test run task. The agent then queries the system to verify that the rule was created correctly.
-
Completion status: The system creates the data quality rule according to your confirmed configuration. If you configured scheduling, the system binds it to the rule. After the test run is complete, the task provides a check result, such as Passed, Exceptions Found, or Execution Error.
-
Viewing and verification: You can log in to Dataphin and navigate to Governance > Data Quality to view the monitoring object and the data quality rule. You can find the results of test runs and scheduled executions in the quality task execution history.
A successful command-line response indicates that the system accepted your request, not that the configuration is complete. To verify the final status, refer to the Dataphin UI.
Appendix: Input parameters
The following table lists reference parameters for configuring a data quality rule. The agent automatically identifies the required information from your command and prompts you only for missing details. You do not need to provide items marked as "Not required," as the system generates them automatically.
|
Parameter |
Required |
Description |
Example |
|
Tenant ID |
Yes |
The 19-digit ID of the target Dataphin tenant. |
1234567890123456789 |
|
Monitoring object type |
Yes |
The type of object to monitor. Options include Dataphin table, global table, data source, metric, and real-time metatable. |
Dataphin table |
|
Specific monitoring object |
Yes |
The specific table, data source, or metric to monitor. You only need to provide the name, and the system automatically locates the object. |
The |
|
Rule name |
Yes |
The name of the data quality rule. |
Not-null check for account phone number |
|
Check type |
Yes |
The data quality dimension to check, such as not-null, uniqueness, value range, enum, format, or fluctuation. |
Not-null |
|
Check field |
Required for field-level rules |
The specific field to check. Not required for table-level rules. |
|
|
Rule severity |
Yes |
Specifies whether the rule is a strong monitoring rule (blocks downstream tasks on failure) or a weak monitoring rule (sends an alarm but does not block tasks). |
Strong monitoring rule |
|
Check condition |
Yes |
The threshold condition that determines whether a check passes or fails. If not configured, the UI displays "Not Configured", and a test run will fail. |
Number of abnormal records equals 0 |
|
Enable exception archiving |
No |
Specifies whether to enable exception archiving for abnormal data. |
Enabled |
|
Scheduling |
No |
Specifies whether to set a scheduled or triggered execution. If enabled, you must specify the scheduling type. |
Run daily at 2:00 AM |
|
Alarm |
No |
Specifies whether to notify the quality owner when a check fails, and the notification method. |
Notify quality owner by email |
|
Perform test run |
No |
Specifies whether to immediately perform a test run for validation after the rule is created. A test run is performed by default. |
Yes |
|
Monitoring object name |
Not required |
The system generates this name from the object's metadata. You do not need to provide it. |
— |