Skip to content

Entity Type quick filter labels are formatted on UI side for proper readable casing.#27515

Open
Jenishpadasala30 wants to merge 3 commits intoopen-metadata:mainfrom
Jenishpadasala30:fix_26805
Open

Entity Type quick filter labels are formatted on UI side for proper readable casing.#27515
Jenishpadasala30 wants to merge 3 commits intoopen-metadata:mainfrom
Jenishpadasala30:fix_26805

Conversation

@Jenishpadasala30
Copy link
Copy Markdown

@Jenishpadasala30 Jenishpadasala30 commented Apr 18, 2026

Describe your changes:

Fixes #26805

Problem

Explore quick filters were displaying values in lowercase (e.g., sample_airflow, john.doe) due to Elasticsearch .keyword fields using lowercase_normalizer. This caused a poor user experience as original casing from the data source was not preserved.

Solution

  • Leveraged backend support for sourceFields (introduced in Fix : case-insensitive issue with aggregation API response  #20734)
  • Enabled top_hits sub-aggregation to fetch original values from _source
  • Updated UI to dynamically pass sourceFields based on filter keys
  • Modified aggregation parsing to use _source values instead of bucket.key
  • Ensured fallback to existing behavior when sourceFields is not provided

Implementation

  • Passed sourceFields through ExploreQuickFilters → ExploreUtils → API

  • Updated getOptionsFromAggregationBucket to extract values from top_hits

  • Added safety checks to handle missing top_hits data

  • Covered special cases like:

    • service.nameservice.displayName
    • tags.tagFQNtags.displayName
    • tier.tagFQNtags.displayName

Testing

  • Verified UI shows proper casing:

    • sample_airflowSAMPLE_AIRFLOW
    • john.doeJohn Doe
    • productProduct Domain
  • Confirmed API returns top_hits only when sourceFields is passed

  • Tested fallback behavior when sourceFields is not provided

  • Added unit tests for aggregation parsing logic

Result

Explore quick filters now display correctly cased values while maintaining case-insensitive filtering behavior.

Type of change:

  • Bug fix

Checklist:

  • I have read the CONTRIBUTING document.
  • My PR title is Fixes #26805: Preserve casing in Explore quick filters using sourceFields
  • I have commented on my code, particularly in hard-to-understand areas.
  • For JSON Schema changes: Not applicable
  • I have added a test that covers the exact scenario we are fixing.

@Jenishpadasala30 Jenishpadasala30 requested a review from a team as a code owner April 18, 2026 20:04
@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!

Comment thread openmetadata-ui/src/main/resources/ui/src/utils/AdvancedSearchUtils.tsx Outdated
…omprehensive documentation and test coverage
@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!

@gitar-bot
Copy link
Copy Markdown

gitar-bot bot commented Apr 19, 2026

Code Review ✅ Approved 2 resolved / 2 findings

Updates the test import path and implements proper bracket notation for array field traversal to fix issue 26805. All identified compilation and logic errors have been resolved.

✅ 2 resolved
Bug: Test file has wrong import path — will fail to compile

📄 openmetadata-ui/src/main/resources/ui/src/utils/tests/AdvancedSearchUtils.casePreservation.test.tsx:14
The test file is located in src/utils/__tests__/ but imports from './AdvancedSearchUtils', which resolves to __tests__/AdvancedSearchUtils (non-existent). Since it uses a relative ./ prefix, Jest's moduleDirectories: ['node_modules', 'src'] won't help — relative imports always resolve from the file's own directory. The import should be '../AdvancedSearchUtils' to reach the parent src/utils/AdvancedSearchUtils.tsx.

Bug: Dot-notation traversal fails for array fields (tags, owners)

📄 openmetadata-ui/src/main/resources/ui/src/utils/AdvancedSearchUtils.tsx:407-415
The getOptionsFromAggregationBucket function traverses _source using dot-notation (e.g., tags.displayName). However, fields like owners, tags, and domains are stored as arrays in Elasticsearch _source (e.g., _source.tags = [{tagFQN: '...', displayName: '...'}, ...]). When the reduce encounters an array at _source.tags, attempting to access .displayName on it will fail the key in obj check and return undefined, causing a silent fallback to bucket.key.

This means the case-preservation feature won't work for tag-based or owner-based filters — the intended use cases mentioned in the PR description (tags.tagFQN → tags.displayName).

Options

Display: compact → Showing less information.

Comment with these commands to change:

Compact
gitar display:verbose         

Was this helpful? React with 👍 / 👎 | Gitar

@Jenishpadasala30 Jenishpadasala30 changed the title Fix 26805 Entity Type quick filter labels are formatted on UI side for proper readable casing. Apr 19, 2026
@Jenishpadasala30 Jenishpadasala30 changed the title Entity Type quick filter labels are formatted on UI side for proper readable casing. Entity Type quick filter labels are formatted on UI side for proper readable casing.#26805 Apr 19, 2026
@Jenishpadasala30 Jenishpadasala30 changed the title Entity Type quick filter labels are formatted on UI side for proper readable casing.#26805 Entity Type quick filter labels are formatted on UI side for proper readable casing. Apr 19, 2026
@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!

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.

Implement proper casing for Explore quick filters using sourceFields

1 participant