Skip to content

Fixes 37506: Backport exact Data Quality table totals and integration fixes to 2.0 - #37913

Merged
TeddyCr merged 3 commits into
open-metadata:2.0from
TeddyCr:backport/37507-37698-2.0
Nov 16, 2026
Merged

TeddyCr merged 3 commits into
open-metadata:2.0from
TeddyCr:backport/37507-37698-2.0

Conversation

@TeddyCr

@TeddyCr TeddyCr commented Nov 16, 2026 •

Copy link
Copy Markdown
Collaborator

Describe your changes:

Fixes #37506 on 2.0.

Backports both merged fixes, in order:

Both commits cherry-picked cleanly. The covered-asset aggregation remains cardinality-based, preserving distinct asset counting across test cases.

Type of change:

  • Bug fix

High-level design:

Reuse the upstream table-count implementation and regression tests. The CI follow-up also corrects ODCS regex-rule mapping for the capabilities of the 2.0 executor. The existing 2.0 Elasticsearch/OpenSearch aggregation implementations support value_count, and UI consumers use the unchanged response field. Includes the case-only table-name regression, the nightly scale regression, and UI API/widget/provider tests. No schemas, migrations, or dependencies changed. ODCS regex rules with nonzero failure tolerance are preserved without creating executable test cases; zero-tolerance rules create regex tests with supported parameters.

Tests:

Use cases covered

  • Table-total API requests use value_count while retaining filter/domain behavior.
  • The coverage widget uses 10,233 total tables and 404 covered tables, yielding 9,829 uncovered tables.
  • The provider exposes the exact 10,233 total.
  • The case-only integration regression creates Orders and orders, filters by schema UUID, and expects value count 2 versus cardinality 1.
  • The scale regression compares the aggregation with the live count above 3,000 tables.

Unit tests

PASSED: 3 Jest suites, 66 tests.

cd openmetadata-ui/src/main/resources/ui
yarn jest src/rest/dataQualityDashboardAPI.test.ts src/components/DataQuality/ChartWidgets/DataAssetsCoveragePieChartWidget/DataAssetsCoveragePieChartWidget.test.tsx src/pages/DataQuality/DataQualityProvider.test.tsx --runInBand --silent

The initial run could not load the generated ANTLR parser and built core-component library in the fresh worktree. After yarn js-antlr and building the branch's core components, all 66 tests passed. Dependencies were installed from the branch's frozen lockfiles. Coverage percentage was not measured.

UI organize-imports, ESLint, and Prettier passed on all four changed UI files and left no diff.

Backend integration tests

BLOCKED — local OpenSearch container startup failed before the regression executed. This PR remains draft.

mvn -B verify -pl :openmetadata-integration-tests -am -Dspring-boot.repackage.skip=true -Dtest=NoUnitTestsInThisRun -Dsurefire.failIfNoSpecifiedTests=false -Psearch-it -DdatabaseType=postgres -DsearchType=opensearch -Djpw.data.mode=ingest -Dit.test=TableTotalCountAggregationIT -Dfailsafe.failIfNoSpecifiedTests=false

The reactor compiled through all 534 integration-test sources and started PostgreSQL. The opensearchproject/opensearch:3.4.0 container exited with code 1 during startup:

WARNING: java.io.tmpdir directory does not exist
Error: Could not find or load main class Cannot
Caused by: java.lang.ClassNotFoundException: Cannot

Stopped the test JVM after confirming the container had exited, avoiding repeated startup attempts. No passing live integration result is claimed. Container disk capacity, /tmp permissions, temporary-directory creation, and a direct JVM launch passed isolated diagnostics; the startup cause remains unresolved.

mvn -B spotless:apply -pl openmetadata-integration-tests passed with zero formatting changes. The newer Java planner and impact-map files are absent on 2.0, so the focused search-it command was selected directly from the existing profile.

Pending: rerun TableTotalCountAggregationIT successfully on PostgreSQL/OpenSearch. Elasticsearch, the nightly TableTotalCountScaleIT, and the full integration suite were not run.

ODCS regex CI follow-up

Commit 04b95f51de5 fixes the regex-threshold mismatch exposed by the data-contract integration tests. The 2.0 regex executor only supports zero failures. Nonzero count/percentage tolerances are now classified as unsupported before test creation, while the original rule remains available for export/re-import. The runnable-test fixture uses zero tolerance; dedicated regression coverage preserves the original 5% case.

Validation on PostgreSQL/OpenSearch:

  • Before the fix: reproduced both original CI assertion failures; the new mapper regression failed for both count and percentage tolerances.
  • After the fix: 201 ODCS unit tests and 4 focused integration tests passed, with no failures, errors, or skips.
  • Integration methods: testODCSImportTurnsQualityRulesIntoTestCases, testODCSExportIncludesTheContractsOwnTestCasesOnce, testODCSRegexToleranceSurvivesExportWithoutAnExecutableTest, and testODCSReimportUpdatesTheSameTestCases.
  • Spotless, the normal commit hooks, and git diff --check passed.
mvn -B verify -pl :openmetadata-integration-tests -am \
  -Dspring-boot.repackage.skip=true -Ppostgres-opensearch \
  -DintegrationTests.lane=parallel \
  '-Dit.test=DataContractResourceIT#testODCSImportTurnsQualityRulesIntoTestCases+testODCSExportIncludesTheContractsOwnTestCasesOnce+testODCSRegexToleranceSurvivesExportWithoutAnExecutableTest+testODCSReimportUpdatesTheSameTestCases' \
  -Dfailsafe.failIfNoSpecifiedTests=false '-Dtest=ODCS*Test' \
  -Dsurefire.failIfNoSpecifiedTests=false

This is focused verification of the ODCS follow-up. The other reported CI failures are outside this fix; the full integration suite and coverage percentage were not rerun/measured.

Ingestion integration tests

Not applicable — no ingestion changes.

Playwright (UI) tests

Not run for this focused backport. Existing related coverage: playwright/e2e/Features/DataQuality/DataQualityDashboard.spec.ts. Browser verification remains outstanding.

Manual testing performed

No interactive UI test. Manual steps for follow-up: open Data Quality Summary and Test Cases with equivalent filters; verify the table denominator matches the exact table count, including case-only names, and that coverage uses the corrected denominator.

UI screen recording / screenshots:

Not applicable — backport of an existing aggregation bug fix; no new UI feature or layout.

Checklist:

  • Linked the original issue and both source PRs.
  • Included both cherry-picked commits with upstream provenance.
  • Included upstream UI and integration regression tests.
  • Java/UI formatting, push hooks, and git diff --check passed.
  • Independent target-branch compatibility review of 2b604576325f37d1ba8547f420670849bcdccbe0 against REVIEW.md: no blockers.
  • Live integration verification — blocked as documented above.
  • Comments: unchanged from upstream.
  • JSON Schema/migrations: not applicable.
  • Decision record: not applicable — existing bug-fix backport.

RetriggerView in GreptileConfidence Score: 4/5

The code changes appear sound, but the outstanding repository style requirements must be satisfied before merging.

Findings

  1. P2 Comparison strings lack constants ▶
  2. P2 Unchanged declarations lack final ▶
  3. P2 Parameter names break naming rules ▶

Summary

This PR backports exact Data Quality table totals and adds regression tests.

  • Data Quality totals count every matching table.
  • ODCS regex rules run only when they allow zero failures.

No runtime tests were run during this review.

Reviews (2) · Last reviewed commit: "Fix ODCS regex rules with unsupported fa..." · Reviewed by Greptile

… `f (open-metadata#37507)

taskr run 0181.
The scale test now counts the same `deleted:false` scope on both sides, and the planned Jest, ESLint, spotless and compile checks pass. The case-only integration test still needs a live run.

(cherry picked from commit 276452a)
* Fix Data Quality table total integration tests

* Remove unit tests for Data Quality integration test helper

(cherry picked from commit b264507)
@TeddyCr
TeddyCr marked this pull request as ready for review November 16, 2026 15:37
@TeddyCr
TeddyCr requested a review from a team as a code owner November 16, 2026 15:37
@TeddyCr
TeddyCr requested review from ShaileshParmar11 and removed request for a team November 16, 2026 15:37
@github-actions

Copy link
Copy Markdown
Contributor

❌ PR checklist incomplete

This PR cannot be merged until the following are addressed on its linked issue:

  • No GitHub issue is linked. Link an issue in the Development section of the PR (or add Fixes #12345 to the description). For a same-org cross-repo issue, add Fixes open-metadata/<repo>#123 to the description.

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 skip-pr-checks label.

Comment on lines +26 to +27
public static long tableTotal(String q, String aggregationQuery) {
DataQualityReport report = dataQualityReport(q, aggregationQuery);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Unchanged declarations lack final

The new Java helpers and tests omit final from parameters and local variables that never change. The repository guide requires it for these declarations. Add final throughout the new Java code before merging.

Context Used: CLAUDE.md (source)

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

Comment on lines +34 to +37
private static DataQualityReport dataQualityReport(String q, String aggregationQuery) {
RequestOptions options =
RequestOptions.builder()
.queryParam("q", q)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Parameter names break naming rules

The new helper uses the single-letter parameter q in tableTotal and dataQualityReport. The repository guide forbids single-letter variables outside short lambdas and loop indices. Rename it to query before merging, while keeping the HTTP parameter name "q" unchanged.

Context Used: CLAUDE.md (source)

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

@TeddyCr
TeddyCr requested a review from a team as a code owner November 16, 2026 20:12
@TeddyCr
TeddyCr requested review from IceS2 and removed request for a team November 16, 2026 20:12
UnsupportedOutcome.class, ODCSQualityRuleMapper.map(List.of(rule), TARGET).getFirst());

assertEquals(rule, unsupported.rule());
assertTrue(unsupported.reason().contains("zero failures"));

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Comparison strings lack constants

The new assertions pass raw strings to .contains() here and .equals() in DataContractResourceIT.java. The repository guide requires named constants for strings used in these comparisons. Replace "zero failures" and "Email format" with constants before merging.

Context Used: CLAUDE.md (source)

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

@gitar-bot

gitar-bot Bot commented Nov 16, 2026

Copy link
Copy Markdown
Code Review ✅ Approved 🟡 Medium risk

ODCS regex rules with nonzero tolerance now produce no executable test, potentially leaving checks unenforced, while table totals switch to exact document counts.

Backports the Data Quality table total fix to 2.0 by switching the aggregation from cardinality to value_count so Summary and Test Cases count every table document, plus the ODCS regex-rule mapping correction for the 2.0 executor. No open issues found.

Verification

Rules No rules evaluated

Functional validation Not enabled

Set up

Auto-approval Not enabled

Set up

For more verification details, comment gitar display:verbose.

Options

Display: compact → Showing compact verification results.

Comment with these commands to change the behavior for this request:

Compact
gitar display:verbose         

Was this helpful? React with 👍 / 👎 | Powered by Gitar — free for open source

@TeddyCr
TeddyCr merged commit db6d332 into open-metadata:2.0 Nov 16, 2026
63 of 74 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants