Skip to main content

Write a rule suite without code

Status: rolling out (#640). Rule authoring is moving onto the data asset detail page — open an asset and add rules right there via a Rules card (the same form-builder this guide describes, lifted into the asset page). That card is rolling out across #640 and lands for everyone at the PR-7 cutover; until then the standalone Rule suites editor below remains the primary surface. Both mount the identical editor, so the steps here apply to either.

Goal

You'll author a rule suite against an existing data asset using only the PLACEHOLDER Cloud UI — no JSON editing, no Python.

Prereqs

  • A data asset that has been profiled at least once. The form-builder pulls its column dropdown from the latest profile run.
  • Workspace editor role or higher.

Steps

  1. Navigate to the asset detail page → click Rule suitesNew.

  2. Name the suite something descriptive — orders-completeness, users-validity. The name is the unit of attribution in alerts and the data-docs site.

  3. Click "Add rule". A panel opens with the available rule types. Pick one. The inline picker offers the same full catalog as the Expectation gallery — pick from either.

    The current shipping set:

    ExpectationWhat it checks
    expect_column_values_to_not_be_nullThe column has no nulls.
    expect_column_values_to_be_nullThe column is always null.
    expect_column_values_to_be_in_setEvery value is from an enumerated list.
    expect_column_values_to_not_be_in_setNo value is in the given (banned) list.
    expect_column_values_to_match_regexEvery value matches a regex.
    expect_column_values_to_not_match_regexNo value matches a regex.
    expect_column_values_to_be_uniqueThe column is unique.
    expect_column_value_lengths_to_be_betweenString length in [min, max].
    expect_column_value_lengths_to_equalString length is exactly N.
    expect_column_values_to_be_betweenNumeric values fall in [min, max].
    expect_column_mean_to_be_betweenThe column mean falls in [min, max].
    expect_column_sum_to_be_betweenThe column sum falls in [min, max].
    expect_column_max_to_be_betweenThe column max falls in [min, max].
    expect_column_min_to_be_betweenThe column min falls in [min, max].
    expect_table_row_count_to_be_betweenRow count in [min, max].
    expect_table_row_count_to_equalRow count is exactly N.
    expect_table_column_count_to_equalColumn count is exactly N.
    unexpected_rows_expectationCustom SQL — see More expressive rules.
  4. Fill in the kwargs — the column picker is populated from the latest profile run. If you don't see your column, run a profile first. For set-based rules (…_to_be_in_set), type the allowed values comma-separated (pending, completed, cancelled); the editor splits them into a list for you.

    Tip — browse the gallery. "Browse the gallery" next to Add rule opens a searchable catalog with descriptions and examples for every rule type; "Use this rule" hands the pick straight back to this editor.

  5. Repeat for every rule you want.

  6. Save. PLACEHOLDER Cloud writes the suite as a GX-compatible JSON blob — portable, version-controllable, and re-importable elsewhere if you ever move off PLACEHOLDER Cloud. A "Suite saved" confirmation appears on success. If Save is disabled, an error summary at the top of the editor names how many rules still need fixing — required fields (e.g. a blank Column) are highlighted in red.

  7. Click "Run now" to validate the suite immediately against the bound asset. You get a fresh ValidationResult row to review.

Verify

  • The suite appears under the asset.
  • A test run produced one ValidationResult row with the expected pass/fail outcomes.

More expressive rules

  • Custom SQL (unexpected_rows_expectation) — write a SELECT that returns rows where the rule is broken. Shipped in FEATURE-9; see Custom SQL expectations.
  • Row conditionsrow_condition: "status = 'shipped'" scopes a column-map rule to a subset of rows. Shipped in FEATURE-11; see Row conditions.
  • Severity — every rule carries an info / warning / error / critical level (default error). Alert rules filter by min_severity so a critical-only Slack channel only fires on the most severe failures, and the validation-result detail page colour-codes each rule by its severity.
  • AI-suggested rules — accept proposed rules from the Suggestions route into the suite with one click. See Accept an AI rule suggestion.

Raw JSON authoring

For CI flows or one-off automation, write the suite JSON directly:

curl -X PUT \
-H "Authorization: Bearer dqk_…" \
-H "Content-Type: application/json" \
-d '{
"suite": {
"rules": [
{"rule_type": "expect_column_values_to_not_be_null", "kwargs": {"column": "email"}},
{"rule_type": "expect_table_row_count_to_be_between", "kwargs": {"min_value": 1, "max_value": 10000000}}
]
}
}' \
https://placeholder.example.com/api/v1/rule-suites/<suite_id>

The blob shape is the same one the form-builder produces; opening a JSON-authored suite in the form-builder works as-is.