Repository navigation
Fixes #27718: Generic and NUMERIC test definitions missing from the Add Test Case dropdown - #32996
Conversation
A test definition that declares no `supportedDataTypes` places no restriction on the columns it can run against, so it should be offered for every column type — the same convention `supportedServices` already follows. Instead, the `supportedDataType` listing filter required a positive match, so those definitions were missing from the dropdown that maps a test case to a column and could not be used at all. - Listing (`TimeSeriesDAOs.TestDefinitionDAO`): let definitions with an absent or empty `supportedDataTypes` through the filter, mirroring `supportedService`. - Ingestion (`filter_incompatible_test_cases`): an empty list no longer rejects every column; previously an absent list also raised a `TypeError`. - UI: drop the rule that made the field required on the OpenMetadata platform, and say "leave empty to support all data types" like the services field does. - Document the "empty means all" contract on the schema, the REST parameter and the MCP tool description. Closes #27718 Co-Authored-By: Claude Opus 5 <[email protected]>
✅ PR checks passedThe linked issue has a description and all required Shipping project fields set. Thanks! |
|
| Count | Rule |
|---|---|
| 1 | react-hooks/exhaustive-deps |
All findings
| Location | Rule | Message | |
|---|---|---|---|
| 🟡 | src/components/TestLibrary/TestDefinitionForm/TestDefinitionFormBody.tsx:346:5 |
react-hooks/exhaustive-deps |
React Hook useMemo has an unnecessary dependency: 'form'. Either exclude it or remove the dependency array. |
Fix locally (fast - only checks files changed in this branch):
make ui-checkstyle-changed…ary.spec.ts The merge of upstream/main into this branch dropped the import while keeping both call sites. This PR had removed the only usage it knew about along with the import; main had meanwhile added two more (#33122, #32071), and the resolution kept those without bringing the import back. Every test in the file that reaches selectEntityType then died with `ReferenceError: selectOptionWithRetry is not defined` -- 5 failures in the chromium-07 shard. The helper itself is unchanged in utils/common.ts; only the import was missing. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Code Review ✅ ApprovedFixes generic data quality test definitions missing for unspecified data types by implementing an "empty means all" convention for OptionsDisplay: compact → Counting what did not apply, without listing it. Comment with these commands to change the behavior for this request:
Was this helpful? React with 👍 / 👎 | Powered by Gitar — free for open source |
|
|



Describe your changes:
Fixes #27718
Two related defects that both made a test definition unreachable in the "Add test case" dropdown.
1. A definition with no
supportedDataTypeswas invisible everywhere.TestDefinitionDAO'ssupportedDataTypefilter (listBefore/listAfter/listCountinTimeSeriesDAOs.java) required a positiveJSON_CONTAINS/@>match, so the dropdown — which callsgetListTestDefinitions({ supportedDataType: columnType })— never returned generic definitions. The siblingsupportedServicesfilter already implemented the "empty means all" convention;supportedDataTypesdid not.TimeSeriesDAOs.java— the filter now also matches an absent or emptysupportedDataTypes, in all three query paths, mirroring thesupportedServiceSQL.test_case_runner.py—filter_incompatible_test_casestreated an empty list as "supports nothing" and raisedTypeError: argument of type 'NoneType' is not iterableon an absent one. Both now mean "runs against any column".TestDefinitionFormBody.tsx— removed the rule that made the field required whenever OpenMetadata was a selected platform, which directly contradicted the new default; replaced with the services field's helper text + "Leave empty to support all data types" placeholder.testDefinition.json/createTestDefinition.json, the RESTsupportedDataTypeparameter, the MCPget_test_definitionsdescription, andTestDefinitionForm.md.2. No test could be added to a
NUMERICcolumn beyond null/unique/missing-count.NUMERICis a distinct member of the columndataTypeenum and is what BigQuery, Postgres, Snowflake and DB2 numeric columns are ingested as, but ten of the seeded column test definitions listedNUMBERandDECIMALand neverNUMERIC. Because the listing filters on the column's exactdataType, mean / min / max / median / stddev / sum / between were unreachable on anyNUMERICcolumn — only the three definitions that happened to listNUMERIC(columnValuesMissingCountToBeEqual,columnValuesToBeNotNull,columnValuesToBeUnique) showed up.Reproduced on
sample_data.ecommerce_db.shopify.dim_customer(every numeric column there isNUMERIC): the dropdown offered 4 options instead of 14.NUMERICadded to the ten column definitions that listNUMBERbut notNUMERIC. The three string-only definitions (columnValuesLengthsToBeBetween,columnValuesToMatchRegex,columnValuesToNotMatchRegex) are deliberately untouched.EntityRepository.initializeEntityreturns early when the entity already exists, so editing the seed JSON only reaches fresh installs.Type of change:
High-level design:
Why the two fixes ship together. They are the same user-visible symptom — "the test I want is not in the dropdown" — reached through the same
supportedDataTypefilter, and the second was only found while verifying the first against a live instance.Migration guards. The backfill is guarded two ways:
NUMERICbeing absent, so re-runs are a no-op;supportedDataTypesarray existing at all, so a definition that declares none — which after this PR means "every data type" — is not silently narrowed to exactly one.It keys on the entity
name, not the seed filename:columnValueToBeAtExpectedLocation.jsondefines an entity namedcolumnValuesToBeAtExpectedLocation(plural).Backward compatibility. Both changes only widen what the filter returns. No definition that was previously offered for a data type stops being offered.
Tests:
Use cases covered
supportedDataTypesis offered when picking a test for a column of any type.NUMBERis still not offered for aVARCHARcolumn.NUMERICcolumn.columnValuesToMatchRegex) is still not offered for aNUMERICcolumn.supportedDataTypes, instead of rejecting it or raisingTypeError.Unit tests
ingestion/tests/unit/data_quality/test_test_case_runner.py(new) — match / mismatch / no-declaration forfilter_incompatible_test_cases.TestDefinitionFormBody.test.tsx— rewritten; previously asserted the required-field behaviour this PR removes.Backend integration tests
openmetadata-integration-tests/.../TestDefinitionResourceIT.javalist_supportedDataTypeFilterKeepsDefinitionsWithoutDataTypes_200_OK— a definition without data types is returned forsupportedDataType=VARCHARwhile aNUMBER-only one is not.list_supportedDataTypeNumericReturnsSeededAggregateDefinitions_200_OK— every seeded numeric aggregate is returned forNUMERIC, andcolumnValuesToMatchRegexis not (so a filter that degenerates into "return everything" fails too).Ingestion integration tests
Not applicable — the ingestion change is a pure predicate, covered by the unit tests above.
Playwright (UI) tests
playwright/e2e/Features/DataQuality/TestLibrary.spec.ts— rewritten; previously asserted the required-field behaviour this PR removes.Manual testing performed
Against a local Docker stack (MySQL + Elasticsearch), on
sample_data.ecommerce_db.shopify.dim_customer:average_order_size(NUMERIC) and captured the request the UI issues:supportedDataTypes.postgres:16container over a fixture covering all four cases: appends whereNUMERICis missing, skips where already present, skips a definition with nosupportedDataTypesarray, skips out-of-scope names; 0 rows on re-run.supportedDataType=VARCHAR(10) andsupportedDataType=BOOLEAN(6) return exactly what they did before.UI screen recording / screenshots:
The UI change is the removal of a validation rule plus a placeholder/helper-text change on the Test Definition form; the user-visible effect of the rest of the PR is which entries appear in the Test Type dropdown, covered by the manual steps above.
Checklist:
Fixes <issue-number>: <short explanation>Fixes #<issue-number>above.The PR is not yet safe to merge because the outstanding supportedDataType filter behavior can return table-level definitions to callers that omit entityType.
Findings
Summary
The PR makes test definitions without supported data types generic and adds NUMERIC support to applicable seeded column tests.
Diagram
%%{init: {'theme': 'neutral'}}%% flowchart LR A[Column selected] --> B[Request test definitions] B --> C{supportedDataTypes} C -->|Absent or empty| D[Generic definition matches] C -->|Contains exact column type| E[Typed definition matches] C -->|Does not contain type| F[Definition excluded] D --> G[Add Test Case dropdown] E --> GReviews (4) · Last reviewed commit: "Merge branch 'main' into agent/issue-277..."