Skip to content

Conversation

IceS2
Copy link
Contributor

@IceS2 IceS2 commented Oct 9, 2025

Describe your changes:

Fixes #23776

Test Cases - No Filters
image

Test Cases - Yesterday Filter (Without Runs)
image

Test Cases - Yesterday Filter ( With Runs)
image

Summary of Changes in UpstreamOpenMetadata

Files Changed (5 files)

  1. openmetadata-service/src/main/java/org/openmetadata/service/search/indexes/TestCaseResultIndex.java
  2. openmetadata-ui/src/main/resources/ui/src/rest/dataQualityDashboardAPI.ts
  3. openmetadata-ui/src/main/resources/ui/src/utils/DataQuality/DataQualityUtils.tsx
  4. openmetadata-ui/src/main/resources/ui/src/pages/DataQuality/DataQualityProvider.tsx
  5. openmetadata-ui/src/main/resources/ui/src/components/common/DatePickerMenu/DatePickerMenu.component.tsx

  1. TestCaseResultIndex.java

Change: Added owners,tags to fields loaded from TestCase entity

// Before
"testSuites,testSuite,testDefinition,entityLink",

// After
"testSuites,testSuite,testDefinition,entityLink,owners,tags",

Impact:

  • Enables owner filtering on timeline charts
  • Enables tag filtering on timeline charts
  • Enables tier filtering (tier is inherited from parent table as a tag via Entity.getEntityTags())

  1. dataQualityDashboardAPI.ts

Change: Fixed empty array handling in 4 functions that build Elasticsearch queries

Applied to: fetchTestCaseSummaryByNoDimension, fetchCountOfIncidentStatusTypeByDays, fetchIncidentTimeMetrics, fetchTestCaseStatusMetricsByDays

// Before - empty arrays caused invalid ES queries
if (filters?.tags || filters?.tier) {
mustFilter.push(buildMustEsFilterForTags([...], true));
}

// After - check if combined array has values
const combinedTags = [...(filters?.tags ?? []), ...(filters?.tier ?? [])];
if (combinedTags.length > 0) {
mustFilter.push(buildMustEsFilterForTags(combinedTags, true));
}

Impact:

  • Fixes empty array bug where [] is truthy in JavaScript, causing invalid nested ES queries with empty should arrays
  • Properly combines tier and tags since both are stored in testCase.tags array

  1. DataQualityUtils.tsx

Change 1: Fixed entity FQN field name for testCase index queries
// Before
[isTableApi ? 'fullyQualifiedName.keyword' : 'entityFQN']

// After
[isTableApi ? 'fullyQualifiedName.keyword' : 'originEntityFQN']

Change 2: Added timestamp range filter for testCase queries
if (filters?.startTs && filters?.endTs && !isTableApi) {
mustFilter.push({
range: {
'testCaseResult.timestamp': {
gte: filters.startTs,
lte: filters.endTs,
},
},
});
}

Impact:

  • Fixed entity FQN filtering on testCase index (correct field is originEntityFQN)
  • Enables timestamp filtering on pie charts and test case queries

  1. DataQualityProvider.tsx

Change: Added timestamp filters to test case summary filters

const filters = {
ownerFqn: params?.owner ? JSON.parse(params.owner)?.name : undefined,
tier: params?.tier ? [params.tier] : undefined,
entityFQN: params?.tableFqn,
startTs: params?.lastRunRange?.startTs, // Added
endTs: params?.lastRunRange?.endTs, // Added
};

Impact: Propagates date range filter to test case summary queries


  1. DatePickerMenu.component.tsx

Change: Removed duplicate millisecond conversion

// Before
const startTs = (values[0]?.startOf('day').valueOf() ?? 0) * 1000;
const endTs = (values[1]?.endOf('day').valueOf() ?? 0) * 1000;

// After
const startTs = values[0]?.startOf('day').valueOf() ?? 0;
const endTs = values[1]?.endOf('day').valueOf() ?? 0;

Impact: Fixes timestamp double conversion (.valueOf() already returns milliseconds)


Overall Impact

Fixed Filtering Issues:

  • ✅ Owner filtering now works on timeline charts
  • ✅ Tag filtering now works on timeline charts
  • ✅ Tier filtering now works on timeline charts (inherited from parent table)
  • ✅ Timestamp filtering now works on all charts
  • ✅ Entity FQN filtering uses correct field name
  • ✅ Empty tag/tier arrays no longer cause ES query failures

Root Causes Addressed:

  1. Missing fields in TestCaseResultIndex (owners, tags not loaded)
  2. Empty array truthiness causing invalid ES queries
  3. Incorrect field name for entity FQN filtering
  4. Missing timestamp propagation to filters
  5. Double millisecond conversion in date picker

Copy link
Contributor

github-actions bot commented Oct 9, 2025

Jest test Coverage

UI tests summary

Lines Statements Branches Functions
Coverage: 63%
63.46% (46290/72946) 40.71% (21863/53700) 43.74% (6958/15907)

@IceS2 IceS2 changed the title Fix/data quality dashboard filtering Fixes #23776 : Fix/data quality dashboard filtering Oct 10, 2025
Copy link

Copy link

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

Labels

Ingestion safe to test Add this label to run secure Github workflows on PRs To release Will cherry-pick this PR into the release branch

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Data Quality Dashboard Not Updating After dbt Test Results Ingestion

4 participants