Skip to content

Update Data Quality’s table total aggregation to use value_count on - #37507

Merged
ShaileshParmar11 merged 1 commit into
open-metadata:mainfrom
TeddyCr:taskr/update-data-quality-s-table-total-0181
Nov 12, 2026
Merged

ShaileshParmar11 merged 1 commit into
open-metadata:mainfrom
TeddyCr:taskr/update-data-quality-s-table-total-0181

Conversation

@TeddyCr

@TeddyCr TeddyCr commented Nov 11, 2026

Copy link
Copy Markdown
Collaborator

Summary

Changed the Data Quality table total aggregation to use value_count on fullyQualifiedName, so Summary and Test Cases use the exact table-document count as their coverage denominator; the covered-entity aggregation remains unchanged. Added UI and integration regression coverage for case-only FQN differences and catalogs with more than 3,000 tables. Jest, ESLint, Spotless, and compile checks pass; reviewers should look first at the case-only integration test, which still needs a live run.

Implementer's note: 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.

Plan

  1. rest/dataQualityDashboardAPI.ts, fetchTotalEntityCount (line ~73): change only aggType=cardinality to aggType=value_count. The result is bucketName=count:aggType=value_count:field=fullyQualifiedName. Leave bucketName, field, index: 'table', the buildDataQualityTableFilters must-filter and domain as they are. Do not touch fetchEntityCoveredWithDQ (aggType=cardinality on originEntityFQN). No change to the widget (DataAssetsCoveragePieChartWidget.component.tsx) or DataQualityProvider.tsx. Both read data[0].fullyQualifiedName via parseInt, and the backend parser (SearchIndexUtils.parseAggregationResults) is generic over the {value} aggregation JSON, so the response shape is unchanged.
  2. rest/dataQualityDashboardAPI.test.ts: update the six fetchTotalEntityCount expectations (lines ~94, 129, 166, 203, 259, 275) to aggType=value_count. Add an explicit assertion that fetchEntityCoveredWithDQ still sends aggType=cardinality:field=originEntityFQN (there may already be one; check and add if missing). That guards the scope constraint.
  3. DataAssetsCoveragePieChartWidget.test.tsx: add a test where fetchTotalEntityCount resolves { data: [{ fullyQualifiedName: '10233' }] } and fetchEntityCoveredWithDQ resolves a covered count (e.g. '404'). Assert that CustomPieChart receives covered=404, notCovered=9829 and total 10233. This covers the case-colliding and >3,000 denominator end to end through the widget. Follow the existing mock and renderWithQueryClient pattern at ~L205-257.
  4. DataQualityProvider.test.tsx: add a test, in the style of the existing deferred-promise tests (~L255-311), where fetchTotalEntityCount resolves '10233'. Assert that the provider's totalEntityCount (or the rendered summary value, via the existing SummaryComponent test-ids) is 10233. Check what SummaryComponent exposes and add a test-id only inside the test file.
  5. New IT openmetadata-integration-tests/.../it/tests/search/TableTotalCountAggregationIT.java. This is the backend-level regression, since the Jest tests mock the REST layer and cannot prove the search engine behaviour. Use @ExtendWith(TestNamespaceExtension.class), TestNamespace, SdkClients.adminClient(), and Awaitility (no Thread.sleep). Copy the getDataQualityReport helper pattern from TestSuiteResourceIT (~L1305: GET /v1/dataQuality/testSuites/dataQualityReport with q, index=table, aggregationQuery).
    • Test A (case-only FQNs): create two tables in one schema whose names differ only by case (e.g. Orders and orders). Scope the query to that schema with term on databaseSchema.fullyQualifiedName plus deleted:false. Await indexing, then assert that value_count on fullyQualifiedName returns 2 and that cardinality returns 1. The cardinality assertion proves the collision mechanism and that the test fails without the fix. If table creation rejects case-only duplicates on this stack, fall back to asserting only th

Verification

status: green (every planned check passed or was already seen green) · 4 checks: 4 skipped on evidence
- [skipped] cd openmetadata-ui/src/main/resources/ui && corepack yarn jest src/rest/dataQualityDashboardAPI.test.ts --silent  (seen green after the last change)
- [skipped] cd openmetadata-ui/src/main/resources/ui && corepack yarn jest src/components/DataQuality/ChartWidgets/DataAssetsCoveragePieChartWidget/DataAssetsCoveragePieChartWidget.test.tsx src/pages/DataQuality/DataQualityProvider.test.tsx --silent  (seen green after the last change)
- [skipped] cd openmetadata-ui/src/main/resources/ui && corepack yarn eslint src/rest/dataQualityDashboardAPI.ts src/rest/dataQualityDashboardAPI.test.ts src/components/DataQuality/ChartWidgets/DataAssetsCoveragePieChartWidget/DataAssetsCoveragePieChartWidget.test.tsx src/pages/DataQuality/DataQualityProvider.test.tsx  (seen green after the last change)
- [skipped] mvn -q spotless:check -pl openmetadata-integration-tests  (seen green after the last change)

Review (luna): approve

Files

.../openmetadata/it/search/SearchAssertions.java   |  4 ++
 .../it/tests/search/DataQualityTableTotal.java     | 47 +++++++++++++
 .../tests/search/TableTotalCountAggregationIT.java | 65 ++++++++++++++++++
 .../tests/search/scale/TableTotalCountScaleIT.java | 80 ++++++++++++++++++++++
 .../DataAssetsCoveragePieChartWidget.test.tsx      | 23 +++++++
 .../pages/DataQuality/DataQualityProvider.test.tsx | 28 ++++++++
 .../ui/src/rest/dataQualityDashboardAPI.test.ts    | 12 ++--
 .../ui/src/rest/dataQualityDashboardAPI.ts         |  2 +-
 8 files changed, 254 insertions(+), 7 deletions(-)

Closes #37506

Opened by taskr run 0181.

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.
@TeddyCr
TeddyCr marked this pull request as ready for review November 11, 2026 00:26
@TeddyCr
TeddyCr requested a review from a team as a code owner November 11, 2026 00:26
@TeddyCr
TeddyCr requested review from shrabantipaul-collate and a balanced review from Copilot November 11, 2026 00:26

Copilot AI left a comment

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.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

@github-actions

Copy link
Copy Markdown
Contributor

❌ PR checklist incomplete

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

@gitar-bot

gitar-bot Bot commented Nov 11, 2026 •

Copy link
Copy Markdown
Code Review ✅ Approved

🟡 Medium risk · Replacing cardinality with value_count changes coverage denominators; missing FQN values in indexed tables could undercount totals and inflate reported coverage.

Switches the Data Quality table total aggregation from cardinality to value_count on fullyQualifiedName, so the coverage denominator matches the exact table-document count for case-only FQN differences and catalogs over 3,000 tables. No 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

@ShaileshParmar11
ShaileshParmar11 merged commit 276452a into open-metadata:main Nov 12, 2026
104 of 107 checks passed
shrabantipaul-collate pushed a commit that referenced this pull request Nov 13, 2026
…ix DQ, search index and incident-time fixtures (#37695)

* test(playwright): refresh stale 2.1 visual baselines and fix the data quality and search index scenes

The visual lane on 2.1 still failed 214 tests after #37656. 199 of the 200
mismatched baselines date from the original capture in #36640 and never ran
in the run #37656 refreshed from, because 6 of 7 shards stopped at
maxFailures. Each is replaced with the first-attempt actual from 2.1 run
43212731841.

- visualData: the batch DQ fixture also answers value_count. #37507 switched
  the table total to value_count, the fixture returned no row, and
  DataAssetsCoveragePieChartWidget threw reading totalData[0], raising an
  error toast on the data quality page and its interaction scenes.
- scenarios: the search index settings tab waits for its empty-state
  placeholder. #37120 removed the panel title the scene waited for; the
  fixture index has no settings.

* test(playwright): pin the incident check time in the visual fixture

The incident timestamp equalled FIXED_DATE while the browser clock keeps
running, so the asset health widget rendered 'Last check N secs ago' with N
depending on scene duration. It is now one hour earlier.

* test(playwright): refresh the 2.1 baselines the fixture fixes changed

Run 43264131527 renders the data quality and data observability scenes with
the value_count fixture fix, the table manage menu, and an advanced-search
nested-group frame that the previous run never reached. Each actual matched
its retry.

* test(playwright): refresh the 2.1 shard 02 baselines and nested group frames

Run 43297316037 is the first 2.1 run where shard 02 ran its tests: dark
announcements, bots, incident manager and advanced-search frames. Each actual
matched its retry. The dark nested group-2 card is identical on main, where
it was captured from run 43263784280; the earlier frames of that scene match
pixel for pixel.

* test(playwright): refresh the 2.1 dark nested-group footer frame

The last advanced-search nested-group frame that earlier 2.1 runs never
reached (run 43307968814). The actual matched its retry.
TeddyCr added a commit that referenced this pull request Nov 16, 2026
… fixes to 2.0 (#37913)

* Update Data Quality’s table total aggregation to use `value_count` on `f (#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 (#37698)

* Fix Data Quality table total integration tests

* Remove unit tests for Data Quality integration test helper

(cherry picked from commit b264507)

* Fix ODCS regex rules with unsupported failure thresholds
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.

Data Quality undercounts table assets and inflates coverage by using FQN cardinality

3 participants