Skip to content

[DQ Threshold W1.3] UI — threshold control, enum sentences, and live preview in the test form #33237

Description

@TeddyCr

Replace the raw-symbol dropdowns with sentences and add the threshold control.

The lever — no schema change

A SELECT's react-hook-form value is a FormSelectItem ({ id, label }). The id stays the raw enum the backend stores; the label is free to be a translated sentence. Stored values never change, so there is no migration and existing test cases pick up the new wording automatically.

Enum → sentence mapping

operator (tableCustomSQLQuery only) completing "The query should return …":

id label reads as
<= at most at most 10 rows.
< fewer than fewer than 10 rows.
>= at least at least 1 row.
> more than more than 1 row.
== exactly exactly 0 rows.
!= anything other than anything other than 0 rows.

"at most" (inclusive) vs "fewer than" (strict) carries the <=/< distinction — unambiguous in English, which the symbols are not.

thresholdUnit — the label is contextual, so resolve from (unit, testDefinitionName), not a flat map:

id row-countable statistical tableCustomSQLQuery
ABSOLUTE rows units rows
PERCENTAGE % of rows / % of non-null values % of the bound % of table rows

strategy (same form, same defect): ROWScount the rows the query returns; COUNTuse the single number the query returns.
dimensionFailurePolicy: OVERALL_ONLYonly the overall result decides; ANY_DIMENSIONany breaching group fails the test.

Live preview sentence

Fail when more than 1% of the non-null values in email do not match the pattern.
Fail when more than 50 rows are null — measured on the 10% sample this table is profiled with.
Fail when the mean of amount falls outside 90–110, allowing a 5% deviation (85.5–115.5).

For statistical tests show the computed effective range — it is the number users reason about, and it makes the zero-bound degenerate case visible immediately.

Files

  • components/DataQuality/AddDataQualityTest/components/ParameterFields.tsx — labels, group threshold + unit into one row
  • utils/ParameterForm/ParameterFieldsUtils.tsthresholdUnit is a new optionValues param; confirm isSelectParam and the prefill classifier cover it (the FormSelectItem prefill trap is called out in that file's own comment)
  • components/DataQuality/AddDataQualityTest/components/TestCaseFormBody.tsx — preview, sampling warning, zero-bound warning
  • src/locale/languages/en-us.json + yarn i18ntranslate the placeholders, per .claude/rules/i18n.md

ParameterForm.tsx (legacy Ant) is not in scope. New UI uses @openmetadata/ui-core-components.

Acceptance

  • Every enum renders its sentence label and still submits its raw id
  • thresholdUnit resolves the right noun per test class
  • thresholdUnit prefills correctly in edit mode
  • Preview correct for each semantic × unit combination, including the effective range

Depends on #33227.

Design spec: docs/plans/2026-09-11-dq-failure-thresholds.md. Parent epic: #16301.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

  • Status
    Release Backlog 🚧

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions