fix(ui): correct is_not_set semantics for Owner/Domain/DataProduct co…#30439
fix(ui): correct is_not_set semantics for Owner/Domain/DataProduct co…#30439shrabantipaul-collate wants to merge 14 commits into
Conversation
…ntract rules
The "Is Not Set" operator on group/some fields (Owners, Domain, DataProduct)
emitted `{"some": [var, {"==": [field, null]}]}`, which JsonLogic evaluates
as vacuously false on an empty array — so the rule always failed even when
the entity genuinely had no owner/domain/data product. Extend the existing
negation-lift transform (already used for array_not_contains/NOT_IN) to also
rewrite this shape to `{"!": {"some": [var, {"!=": [field, null]}]}}`, and
unskip the three affected Playwright tests.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
❌ PR checklist incompleteThis PR cannot be merged until the following are addressed on its linked issue:
The fields live on the linked issue in the Shipping project (open the issue → right sidebar → Projects). After you set them, re-run this check (or push a commit) — issue/project changes do not re-trigger it automatically. Maintainers can bypass this check by adding the |
|
Hi there 👋 Thanks for your contribution! The OpenMetadata team will review the PR shortly! Once it has been labeled as Let us know if you need any help! |
✅ Playwright Results — workflow succeededValidated commit ✅ 578 passed · ❌ 0 failed · 🟡 0 flaky · ⏭️ 5 skipped · 🧰 0 lifecycle flaky PerformanceBlocking targets: ✅ met · Optimization targets: 🟡 in progress Shard-job maxima below are not the full workflow wall time; the linked run includes build, fixture, planning, and reporting. 🕒 Full workflow signal wall (to summary) 50m 46s ⏱️ Max setup 3m 0s · max shard execution 16m 56s · max shard-job elapsed before upload 20m 7s · reporting 4s 🌐 206.47 requests/attempt · 2.94 app boots/UI scenario · 5.31% common-shard skew Optimization targets still in progress:
How to debug locally# Download playwright-test-results-<shard> artifact and unzip
npx playwright show-trace path/to/trace.zip # view trace |
|
Hi there 👋 Thanks for your contribution! The OpenMetadata team will review the PR shortly! Once it has been labeled as Let us know if you need any help! |
Fixes the gap identified by Greptile: contracts saved before the
negation-lift rewrite retain the vacuously-false {"some": [var,
{"==": [field, null]}]} pattern in the database. Without this change
those contracts continue to report failed validation until the user
manually re-edits each rule. Applying getNegativeQueryForNotContainsReverserOperation
on load normalizes stale persisted rules the next time the contract
form is opened and saved.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…ll fix Every guard added in response to a bot comment (form-load normalization, live-edit confirmation, occurrence counting) immediately surfaced a new, narrower edge case from the same bots, because none of them can be made airtight without stable node identity linking the JsonLogic rule back to its query-builder tree. The actual goal of this PR is unskipping the three Owner/Domain/DataProduct Is_Not_Set Playwright tests, which only needs the JsonLogic transform fix. Reverted ContractSemanticFormTab.tsx/test.tsx and DataContractUtils.ts/test.ts to main (dropping getNormalizedContractSemantics, isFieldUsingIsNullOperator, createIsNullFieldConfirmation and the guard threading). Restored getNegativeQueryForNotContainsReverserOperation to the original unconditional rewrite for the is_null shape, consistent with how the existing contains/in shapes are already handled unconditionally in the same function — confirmed unambiguous by construction since the query builder has no other path that emits that exact AST. Normalizing already-persisted legacy contracts and reconciling the Run Now validation path against unsaved form state are real gaps, but they need a server-side fix and are out of scope for unskipping these tests. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Code Review ✅ Approved 3 resolved / 3 findingsCorrects the "Is Not Set" JsonLogic evaluation for Owner, Domain, and DataProduct fields by lifting negations and unskips the associated Playwright tests. Consider addressing the minor finding where same-field rule rewrites could target the incorrect sibling. ✅ 3 resolved✅ Edge Case: Rules lacking a persisted jsonTree are not normalized
✅ Edge Case: Load-time normalization guards ==null but not contains/in shapes
✅ Edge Case: Rewrite of same-field ==null rule may target the wrong sibling
OptionsDisplay: compact → Showing less information. Comment with these commands to change the behavior for this request:
Was this helpful? React with 👍 / 👎 | Gitar |
| // Pattern generated by the "Is Not Set" (is_null) operator: | ||
| // {"some": [var, {"==": [field, null]}]} | ||
| const equalsNullArgs = condition?.['==']; | ||
| if ( | ||
| Array.isArray(equalsNullArgs) && | ||
| equalsNullArgs.length === 2 && | ||
| equalsNullArgs[1] === null | ||
| ) { | ||
| const [field] = equalsNullArgs; | ||
|
|
||
| return { | ||
| '!': { | ||
| some: [variable, { '!=': [field, null] }], | ||
| }, | ||
| }; | ||
| } | ||
| } |
There was a problem hiding this comment.
Persisted rules remain unnormalized
When a user runs validation on an existing contract containing a legacy Owner, Domain, or DataProduct some/==null rule without editing and saving that rule first, this query-builder transformation never runs. Run Now therefore evaluates the unchanged persisted expression, causing a genuinely unset grouped field to report failed contract validation.
|



…ntract rules
The "Is Not Set" operator on group/some fields (Owners, Domain, DataProduct) emitted
{"some": [var, {"==": [field, null]}]}, which JsonLogic evaluates as vacuously false on an empty array — so the rule always failed even when the entity genuinely had no owner/domain/data product. Extend the existing negation-lift transform (already used for array_not_contains/NOT_IN) to also rewrite this shape to{"!": {"some": [var, {"!=": [field, null]}]}}, and unskip the three affected Playwright tests.Describe your changes:
Fixes #
I worked on ... because ...
Type of change:
High-level design:
N/A — small change.
Tests:
Use cases covered
Unit tests
Backend integration tests
Ingestion integration tests
Playwright (UI) tests
Manual testing performed
UI screen recording / screenshots:
Not applicable.
Checklist:
Fixes <issue-number>: <short explanation>Fixes #<issue-number>above.Greptile Summary
Corrects generated Is Not Set JsonLogic for grouped fields.
some/==nullexpressions as the negation ofsome/!=null.Confidence Score: 3/5
The PR is not safe to merge until direct validation of existing legacy Is Not Set rules receives the corrected semantics.
The correction is limited to interactive query-builder changes, while Run Now evaluates persisted legacy rules verbatim and therefore retains the original incorrect empty-array result.
openmetadata-ui/src/main/resources/ui/src/utils/JSONLogicSearchClassBase.ts and the Data Contract validation path
Important Files Changed
Reviews (9): Last reviewed commit: "Merge branch 'main' into fix/data-contra..." | Re-trigger Greptile