Skip to content

Fixes #27458: Display SQL expression for library DQ tests#27516

Open
piyushdotcomm wants to merge 5 commits intoopen-metadata:mainfrom
piyushdotcomm:fix-27458-dq-library-sql-expression
Open

Fixes #27458: Display SQL expression for library DQ tests#27516
piyushdotcomm wants to merge 5 commits intoopen-metadata:mainfrom
piyushdotcomm:fix-27458-dq-library-sql-expression

Conversation

@piyushdotcomm
Copy link
Copy Markdown

@piyushdotcomm piyushdotcomm commented Apr 18, 2026

Fixes #27458

I worked on displaying the SQL expression for library-based Data Quality tests because the test details
page only showed SQL for custom SQL tests. Library tests already expose their SQL template through
TestDefinition.sqlExpression, but the result/details tab was not requesting or rendering that field.

Changes made:

  • Fetch TestDefinition with parameterDefinition and sqlExpression fields in the test case result
    tab.
  • Render a read-only SQL Expression block for library-based tests when TestDefinition.sqlExpression is
    available.
  • Preserve existing custom SQL behavior by preferring TestCase.parameterValues.sqlExpression when
    present.
  • Keep the edit action only for custom SQL parameter values, not for library definition SQL.
  • Added unit tests for:
    • requesting sqlExpression from the test definition API
    • rendering library test SQL expression
    • preserving custom SQL precedence
  • Added Playwright coverage for viewing a library test SQL expression in the test case details UI.

Type of change:

  • Improvement

Checklist:

  • I have read the CONTRIBUTING document. - [x] My PR title is Fixes <issue-number>: <short explanation>
  • I have commented on my code, particularly in hard-to-understand areas.
  • For JSON Schema changes: I updated the migration scripts or explained why it is not needed.
  • I have added tests around the new logic.

Testing:

  • playwright test playwright/e2e/Features/DataQuality/TestCaseResultPermissions.spec.ts --list
    • New Playwright test is discovered

Added Playwright test:

  • User with TEST_CASE.VIEW_ALL can view library test SQL expression in UI

Summary by Gitar

  • Playwright test stabilization:
    • Added verification of status code 200 to the data product tag patch request in common.ts.
    • Adjusted API response listener in TestCaseResultPermissions.spec.ts to improve test reliability for library DQ test definitions.

This will update automatically on new commits.

@piyushdotcomm piyushdotcomm requested a review from a team as a code owner April 18, 2026 20:35
@github-actions
Copy link
Copy Markdown
Contributor

Hi there 👋 Thanks for your contribution!

The OpenMetadata team will review the PR shortly! Once it has been labeled as safe to test, the CI workflows
will start executing and we'll be able to make sure everything is working as expected.

Let us know if you need any help!

@piyushdotcomm
Copy link
Copy Markdown
Author

Hi @harshach , could you please add the safe to test label when you get a chance?

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 18, 2026

Jest test Coverage

UI tests summary

Lines Statements Branches Functions
Coverage: 63%
63.72% (59689/93661) 43.69% (31481/72040) 46.74% (9448/20210)

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 18, 2026

🔴 Playwright Results — 2 failure(s), 26 flaky

✅ 3660 passed · ❌ 2 failed · 🟡 26 flaky · ⏭️ 89 skipped

Shard Passed Failed Flaky Skipped
🟡 Shard 1 480 0 1 4
🔴 Shard 2 648 1 3 7
🔴 Shard 3 654 1 6 1
🟡 Shard 4 628 0 6 27
🟡 Shard 5 609 0 2 42
🟡 Shard 6 641 0 8 8

Genuine Failures (failed on all attempts)

Features/DataQuality/TestCaseResultPermissions.spec.ts › User with TEST_CASE.VIEW_ALL can view library test SQL expression in UI (shard 2)
�[31mTest timeout of 60000ms exceeded.�[39m
Features/RestoreEntityInheritedFields.spec.ts › Validate restore with Inherited domain and data products assigned (shard 3)
Error: Timeout 60000ms exceeded while waiting on the predicate
🟡 26 flaky test(s) (passed on retry)
  • Pages/UserCreationWithPersona.spec.ts › Create user with persona and verify on profile (shard 1, 1 retry)
  • Features/BulkEditEntity.spec.ts › Glossary (shard 2, 1 retry)
  • Features/DataQuality/TestCaseImportExportE2eFlow.spec.ts › Admin: Complete export-import-validate flow (shard 2, 1 retry)
  • Features/DataQuality/TestCaseResultPermissions.spec.ts › User with only VIEW cannot see edit action and cannot POST results (shard 2, 1 retry)
  • Features/RestoreEntityInheritedFields.spec.ts › Validate restore with Inherited domain and data products assigned (shard 3, 2 retries)
  • Features/RestoreEntityInheritedFields.spec.ts › Validate restore with Inherited domain and data products assigned (shard 3, 1 retry)
  • Features/RestoreEntityInheritedFields.spec.ts › Validate restore with Inherited domain and data products assigned (shard 3, 1 retry)
  • Features/RestoreEntityInheritedFields.spec.ts › Validate restore with Inherited domain and data products assigned (shard 3, 2 retries)
  • Features/UserProfileOnlineStatus.spec.ts › Should not show online status for inactive users (shard 3, 1 retry)
  • Flow/PersonaFlow.spec.ts › Set default persona for team should work properly (shard 3, 1 retry)
  • Pages/Customproperties-part2.spec.ts › entityReferenceList shows item count, scrollable list, no expand toggle (shard 4, 1 retry)
  • Pages/DataContracts.spec.ts › Create Data Contract and validate for Spreadsheet (shard 4, 1 retry)
  • Pages/DescriptionVisibility.spec.ts › Data Product description card collapse hides content and expand restores it (shard 4, 1 retry)
  • Pages/Entity.spec.ts › Set & Update table-cp, hyperlink-cp, string, integer, markdown, number, duration, email, enum, sqlQuery, timestamp, entityReference, entityReferenceList, timeInterval, time-cp, date-cp, dateTime-cp Custom Property (shard 4, 1 retry)
  • Pages/Entity.spec.ts › Announcement create, edit & delete (shard 4, 1 retry)
  • Pages/Entity.spec.ts › Tag Add, Update and Remove (shard 4, 1 retry)
  • Pages/EntityDataConsumer.spec.ts › Tier Add, Update and Remove (shard 5, 1 retry)
  • Pages/ExplorePageRightPanel.spec.ts › Should allow Data Consumer to edit glossary terms for pipeline (shard 5, 1 retry)
  • Pages/Lineage/DataAssetLineage.spec.ts › verify create lineage for entity - Dashboard (shard 6, 1 retry)
  • Pages/Lineage/DataAssetLineage.spec.ts › verify create lineage for entity - Metric (shard 6, 1 retry)
  • Pages/Lineage/LineageFilters.spec.ts › Verify lineage schema filter selection (shard 6, 1 retry)
  • Pages/Lineage/LineageRightPanel.spec.ts › Verify custom properties tab IS visible for supported type: searchIndex (shard 6, 1 retry)
  • Pages/ODCSImportExport.spec.ts › Multi-object ODCS contract - object selector shows all schema objects (shard 6, 1 retry)
  • Pages/Teams.spec.ts › Teams Page Flow (shard 6, 1 retry)
  • Pages/Users.spec.ts › Permissions for table details page for Data Consumer (shard 6, 1 retry)
  • VersionPages/EntityVersionPages.spec.ts › Directory (shard 6, 1 retry)

📦 Download artifacts

How to debug locally
# Download playwright-test-results-<shard> artifact and unzip
npx playwright show-trace path/to/trace.zip    # view trace

@gitar-bot
Copy link
Copy Markdown

gitar-bot bot commented Apr 19, 2026

Code Review ✅ Approved 1 resolved / 1 findings

Enables display of SQL expressions for library data quality tests, resolving the accidental inclusion of a backup spec file. No issues remain.

✅ 1 resolved
Quality: Backup file .spec.ts.bak accidentally committed to repo

📄 openmetadata-ui/src/main/resources/ui/playwright/e2e/Features/DataQuality/TestCaseResultPermissions.spec.ts.bak:1-15
The file TestCaseResultPermissions.spec.ts.bak (499 lines) is a full copy of the spec file and appears to have been accidentally committed. .bak files should not be checked into version control — they add clutter, confuse tooling, and may diverge from the real spec over time.

Options

Display: compact → Showing less information.

Comment with these commands to change:

Compact
gitar display:verbose         

Was this helpful? React with 👍 / 👎 | Gitar

@sonarqubecloud
Copy link
Copy Markdown

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

Labels

safe to test Add this label to run secure Github workflows on PRs

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Display SQL Formula for Library-Based DQ Tests, similar to how custom SQL tests are shown

2 participants