Skip to content

[BUGFIX] fix cellSettings not applied for columns with no data in any query#700

Open
rajusem wants to merge 1 commit into
perses:mainfrom
rajusem:OBSINTA-1497
Open

[BUGFIX] fix cellSettings not applied for columns with no data in any query#700
rajusem wants to merge 1 commit into
perses:mainfrom
rajusem:OBSINTA-1497

Conversation

@rajusem

@rajusem rajusem commented Jun 25, 2026

Copy link
Copy Markdown
Contributor

Summary

Fixes cellSettings conditional formatting (e.g., showing "N/A" for null values) not being applied for columns where no query returns any data — such as cpu_request_hard or memory_request_hard when no ResourceQuotas exist on the cluster.

Root cause

The keys array is computed only from data rows. When a query returns no data at all (empty series), its column key (e.g., value #5) never appears in any row and is therefore absent from keys. The keysAsObj extension then never adds undefined for that column, so the cellSettings null condition is never evaluated — resulting in blank cells instead of "N/A".

This is distinct from the filtering bug fixed in #688, where the column key existed in some rows but cellConfig indices were misaligned after filtering.

Fix

Include column names from columnSettings in the keys array, so that columns defined in the panel spec are always extended with undefined in keysAsObj and evaluated for cellSettings conditions — even when no query produces data for them.

How to reproduce (before fix)

  1. Create a Table panel with multiple queries where one query returns no data at all (e.g., kube_resourcequota when no ResourceQuotas exist)
  2. Define the empty query's column in columnSettings (e.g., value #5 as "CPU Request Hard")
  3. Add cellSettings with a Misc/null condition (text: "N/A")
  4. Other columns with partial data correctly show N/A
  5. Bug: The column with no data shows blank instead of N/A

Tests added

  • Column defined in columnSettings but with completely empty query data shows N/A for all rows
  • Uses MOCK_MULTI_QUERY_DATA_EMPTY (empty series) to simulate the real-world scenario

Uses ARIA role-based selectors per UI guidelines.

Screenshots

request_hard_issue

Checklist

  • Pull request has a descriptive title and context useful to a reviewer.
  • Pull request title follows the [<catalog_entry>] <commit message> naming convention using one of the
    following catalog_entry values: FEATURE, ENHANCEMENT, BUGFIX, BREAKINGCHANGE, DOC,IGNORE.
  • All commits have DCO signoffs.

… query

When a column is defined in columnSettings but no query returns data for
it (e.g. cpu_request_hard when no ResourceQuotas exist), the column key
is absent from the keys array. This prevents keysAsObj from extending
rows with undefined for that column, so the cellSettings null condition
is never evaluated and the column shows blank instead of N/A.

Fix: include column names from columnSettings in the keys array so that
columns with no data are still evaluated for cellSettings conditions.

Signed-off-by: Raj Zalavadia <rzalavad@redhat.com>
@rajusem rajusem requested a review from a team as a code owner June 25, 2026 13:13
@rajusem rajusem requested review from jgbernalp and removed request for a team June 25, 2026 13:13
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.

1 participant