Skip to content

fix(dashboard): clean up JSON formatting and contribution suffix in V…#40683

Merged
rusackas merged 3 commits into
apache:masterfrom
rabumaabraham:fix-table-headers
Jun 5, 2026
Merged

fix(dashboard): clean up JSON formatting and contribution suffix in V…#40683
rusackas merged 3 commits into
apache:masterfrom
rabumaabraham:fix-table-headers

Conversation

@rabumaabraham
Copy link
Copy Markdown
Contributor

@rabumaabraham rabumaabraham commented Jun 2, 2026

SUMMARY

This PR fixes a bug where the "View as Table" modal displays raw JSON strings (e.g., {"label": "..."}) and raw suffixes (e.g., __contribution) in column headers instead of clean, human-readable labels.

This builds directly on top of the previous autonomous attempt to resolve the custom-labeled metrics bug, ensuring data row values populate correctly without breaking AG Grid field matching while fully cleaning up the header names.

BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF

Before (Raw JSON)

34

After (Clean Headers)

45

TESTING INSTRUCTIONS

  1. Open a dashboard containing a Pie Chart that uses custom metric labels.
  2. Click the three dots (...) on the chart and select View as table.
  3. Verify that the table headers show clean names and that the row data populates numbers correctly instead of saying undefined.

ADDITIONAL INFORMATION

@dosubot dosubot Bot added the change:frontend Requires changing the frontend label Jun 2, 2026
@netlify
Copy link
Copy Markdown

netlify Bot commented Jun 2, 2026

Deploy Preview for superset-docs-preview ready!

Name Link
🔨 Latest commit bae49a6
🔍 Latest deploy log https://app.netlify.com/projects/superset-docs-preview/deploys/6a21f7cd75582a000819649c
😎 Deploy Preview https://deploy-preview-40683--superset-docs-preview.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

Copy link
Copy Markdown
Contributor

@bito-code-review bito-code-review Bot left a comment

Choose a reason for hiding this comment

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

Code Review Agent Run #a00a35

Actionable Suggestions - 1
  • superset-frontend/src/explore/components/DataTablesPane/components/useGridResultTable.tsx - 1
    • CWE-6262: Missing test coverage for JSON parsing · Line 41-57
Review Details
  • Files reviewed - 1 · Commit Range: da0e100..da0e100
    • superset-frontend/src/explore/components/DataTablesPane/components/useGridResultTable.tsx
  • Files skipped - 0
  • Tools
    • Whispers (Secret Scanner) - ✔︎ Successful
    • Detect-secrets (Secret Scanner) - ✔︎ Successful

Bito Usage Guide

Commands

Type the following command in the pull request comment and save the comment.

  • /review - Manually triggers a full AI review.

  • /pause - Pauses automatic reviews on this pull request.

  • /resume - Resumes automatic reviews.

  • /resolve - Marks all Bito-posted review comments as resolved.

  • /abort - Cancels all in-progress reviews.

Refer to the documentation for additional commands.

Configuration

This repository uses Superset You can customize the agent settings here or contact your Bito workspace admin at evan@preset.io.

Documentation & Help

AI Code Review powered by Bito Logo

@hainenber
Copy link
Copy Markdown
Contributor

I'll examine this soon. A bit busy at work atm.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

@pull-request-size pull-request-size Bot added size/M and removed size/S labels Jun 2, 2026
@rabumaabraham
Copy link
Copy Markdown
Contributor Author

@aminghadersohi Thank you for the feedback! I have updated the logic to use .slice() to strictly target the suffix, integrated the getMetricLabel core helper to handle simple metrics, and fixed the catch block per your suggestions. Pushed the updates!

Copy link
Copy Markdown
Contributor

@aminghadersohi aminghadersohi left a comment

Choose a reason for hiding this comment

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

MEDIUM

  • useGridResultTable.tsx:58' (contribution)' is a UI-facing string with no i18n wrapper. Other UI strings in Superset use t(). Suggestion: suffix = ` (${t('contribution')})`
  • No tests added for the new logic. useGridColumns now has non-trivial branching (contribution-suffix stripping, JSON parse + getMetricLabel fallback). Test files exist at DataTablesPane/test/ and should cover: plain column, __contribution column, JSON-metric column, JSON-metric + contribution, non-JSON display name.

NIT

  • useGridResultTable.tsx:48let cleanHeader = rawHeader is dead code; the value is unconditionally overwritten at line 70. Remove it or use const cleanHeader = \${cleaned}${suffix}`` after the try/catch.
  • useGridResultTable.tsx:53,56'__contribution' appears twice; extract to a named constant.

@bito-code-review
Copy link
Copy Markdown
Contributor

bito-code-review Bot commented Jun 2, 2026

Code Review Agent Run #533ffc

Actionable Suggestions - 0
Review Details
  • Files reviewed - 1 · Commit Range: da0e100..ad76289
    • superset-frontend/src/explore/components/DataTablesPane/components/useGridResultTable.tsx
  • Files skipped - 0
  • Tools
    • Whispers (Secret Scanner) - ✔︎ Successful
    • Detect-secrets (Secret Scanner) - ✔︎ Successful

Bito Usage Guide

Commands

Type the following command in the pull request comment and save the comment.

  • /review - Manually triggers a full AI review.

  • /pause - Pauses automatic reviews on this pull request.

  • /resume - Resumes automatic reviews.

  • /resolve - Marks all Bito-posted review comments as resolved.

  • /abort - Cancels all in-progress reviews.

Refer to the documentation for additional commands.

Configuration

This repository uses Superset You can customize the agent settings here or contact your Bito workspace admin at evan@preset.io.

Documentation & Help

AI Code Review powered by Bito Logo

@rabumaabraham
Copy link
Copy Markdown
Contributor Author

@aminghadersohi addressed the comments: added tests for the column label hook, extracted the strings, and added i18n support. Tests are passing locally, ready for your review.

@bito-code-review
Copy link
Copy Markdown
Contributor

bito-code-review Bot commented Jun 3, 2026

Code Review Agent Run #67aadd

Actionable Suggestions - 0
Review Details
  • Files reviewed - 2 · Commit Range: ad76289..0191942
    • superset-frontend/src/explore/components/DataTablesPane/components/useGridResultTable.tsx
    • superset-frontend/src/explore/components/DataTablesPane/test/DataTablesPane.test.tsx
  • Files skipped - 0
  • Tools
    • Whispers (Secret Scanner) - ✔︎ Successful
    • Detect-secrets (Secret Scanner) - ✔︎ Successful

Bito Usage Guide

Commands

Type the following command in the pull request comment and save the comment.

  • /review - Manually triggers a full AI review.

  • /pause - Pauses automatic reviews on this pull request.

  • /resume - Resumes automatic reviews.

  • /resolve - Marks all Bito-posted review comments as resolved.

  • /abort - Cancels all in-progress reviews.

Refer to the documentation for additional commands.

Configuration

This repository uses Superset You can customize the agent settings here or contact your Bito workspace admin at evan@preset.io.

Documentation & Help

AI Code Review powered by Bito Logo

Copy link
Copy Markdown
Contributor

@aminghadersohi aminghadersohi left a comment

Choose a reason for hiding this comment

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

All prior review comments addressed — the suffix stripping, getMetricLabel usage, i18n, test coverage, and code cleanup all look correct. Waiting on CI to fully run (maintainer is approving the workflow now).

@codecov
Copy link
Copy Markdown

codecov Bot commented Jun 4, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 64.07%. Comparing base (875673f) to head (bae49a6).
⚠️ Report is 10 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master   #40683   +/-   ##
=======================================
  Coverage   64.07%   64.07%           
=======================================
  Files        2664     2664           
  Lines      143829   143840   +11     
  Branches    33083    33085    +2     
=======================================
+ Hits        92160    92171   +11     
  Misses      50060    50060           
  Partials     1609     1609           
Flag Coverage Δ
javascript 67.63% <100.00%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@rabumaabraham
Copy link
Copy Markdown
Contributor Author

@rusackas the branch has been successfully rebased and all review comments are addressed and approved. Could you please approve the workflows so the checks can finish up for merge? Thank you!

@bito-code-review
Copy link
Copy Markdown
Contributor

bito-code-review Bot commented Jun 5, 2026

Code Review Agent Run #ce1c61

Actionable Suggestions - 0
Review Details
  • Files reviewed - 2 · Commit Range: 65c6516..bae49a6
    • superset-frontend/src/explore/components/DataTablesPane/components/useGridResultTable.tsx
    • superset-frontend/src/explore/components/DataTablesPane/test/DataTablesPane.test.tsx
  • Files skipped - 0
  • Tools
    • Whispers (Secret Scanner) - ✔︎ Successful
    • Detect-secrets (Secret Scanner) - ✔︎ Successful

Bito Usage Guide

Commands

Type the following command in the pull request comment and save the comment.

  • /review - Manually triggers a full AI review.

  • /pause - Pauses automatic reviews on this pull request.

  • /resume - Resumes automatic reviews.

  • /resolve - Marks all Bito-posted review comments as resolved.

  • /abort - Cancels all in-progress reviews.

Refer to the documentation for additional commands.

Configuration

This repository uses Superset You can customize the agent settings here or contact your Bito workspace admin at evan@preset.io.

Documentation & Help

AI Code Review powered by Bito Logo

@rusackas rusackas added the merge-if-green If approved and tests are green, please go ahead and merge it for me label Jun 5, 2026
@rusackas
Copy link
Copy Markdown
Member

rusackas commented Jun 5, 2026

Running CI, will merge if/when it passes.

@rusackas rusackas merged commit 863e935 into apache:master Jun 5, 2026
64 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

change:frontend Requires changing the frontend merge-if-green If approved and tests are green, please go ahead and merge it for me size/M

Projects

None yet

Development

Successfully merging this pull request may close these issues.

"Undefined" is displayed as the metric value for custom-labeled metrics when using the "View as Table" option from a chart in the dashboard view

5 participants