Skip to content

fix(dashboard): restore existingGroupBy in buildExistingColumnsSet and add null guards#39416

Open
sadpandajoe wants to merge 4 commits intomasterfrom
fix-dashbboard-frontend-error
Open

fix(dashboard): restore existingGroupBy in buildExistingColumnsSet and add null guards#39416
sadpandajoe wants to merge 4 commits intomasterfrom
fix-dashbboard-frontend-error

Conversation

@sadpandajoe
Copy link
Copy Markdown
Member

SUMMARY

PR #39356 (c3a0f2749b) removed existing groupby columns from buildExistingColumnsSet() in getFormDataWithExtraFilters.ts. This caused processGroupByCustomizations() to replace charts' base groupby instead of merging with it, crashing dashboards that use chart customizations (dynamic groupby feature).

This PR:

  • Restores existingGroupBy in buildExistingColumnsSet so base groupby columns are treated as existing (not overridden)
  • Adds null guard in isLegacyChartCustomizationFormat() to reject legacy items with customization: null
  • Adds null filter in normalizeChartCustomizationsForScopeCalculation() to prevent null items from reaching migrateChartCustomization()

BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF

N/A — no UI changes; this fixes a crash in the chart render path.

TESTING INSTRUCTIONS

  1. Open a dashboard with chart customizations (dynamic groupby) where the selected column overlaps with the chart's existing groupby
  2. Verify charts render without crashing and preserve their multi-column base groupby
  3. Run the test suite: npx jest --testPathPattern="getFormDataWithExtraFilters|migrateChartCustomization|DashboardContainer" — 59 tests pass including 6 new regression tests

ADDITIONAL INFORMATION

  • Has associated issue:
  • Required feature flags:
  • Changes UI
  • Includes DB Migration (follow approval process in SIP-59)
    • Migration is atomic, supports rollback & is backwards-compatible
    • Confirm DB migration upgrade and downgrade tested
    • Runtime estimates and downtime expectations provided
  • Introduces new feature or API
  • Removes existing feature or API

…d add null guards

PR #39356 removed existing groupby columns from buildExistingColumnsSet(),
causing processGroupByCustomizations() to replace charts' base groupby
instead of merging. This crashed dashboards with chart customizations
(dynamic groupby). Also adds null guards in isLegacyChartCustomizationFormat()
and normalizeChartCustomizationsForScopeCalculation() for legacy items with
customization: null.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@dosubot dosubot bot added change:frontend Requires changing the frontend dashboard Namespace | Anything related to the Dashboard labels Apr 16, 2026
@sadpandajoe sadpandajoe added the 🎪 ⚡ showtime-trigger-start Create new ephemeral environment for this PR label Apr 16, 2026
@github-actions github-actions bot added 🎪 5ac2904 🚦 building Environment 5ac2904 status: building 🎪 5ac2904 📅 2026-04-16T21-22 Environment 5ac2904 created at 2026-04-16T21-22 🎪 5ac2904 🤡 sadpandajoe Environment 5ac2904 requested by sadpandajoe 🎪 ⌛ 48h Environment expires after 48 hours (default) and removed 🎪 ⚡ showtime-trigger-start Create new ephemeral environment for this PR labels Apr 16, 2026
@github-actions
Copy link
Copy Markdown
Contributor

🎪 Showtime is building environment on GHA for 5ac2904

@github-actions github-actions bot added 🎪 5ac2904 🚦 deploying Environment 5ac2904 status: deploying and removed 🎪 5ac2904 🚦 building Environment 5ac2904 status: building labels Apr 16, 2026
@bito-code-review
Copy link
Copy Markdown
Contributor

In the normalizeChartCustomizationsForScopeCalculation function, the added .filter(item => item != null) ensures item cannot be undefined or null after filtering. item represents an object from the chartCustomizations array, not an empty array.

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 #24052

Actionable Suggestions - 1
  • superset-frontend/src/dashboard/util/getFormDataWithExtraFilters.test.ts - 1
Additional Suggestions - 1
  • superset-frontend/src/dashboard/components/DashboardBuilder/DashboardContainer.test.tsx - 1
    • Misleading test name · Line 703-703
      The test name incorrectly describes the item as 'legacy', but according to isLegacyChartCustomizationFormat, items with customization: null are not legacy format since customization != null is required for legacy. This could mislead developers about what the test covers.
Review Details
  • Files reviewed - 6 · Commit Range: 5ac2904..5ac2904
    • superset-frontend/src/dashboard/components/DashboardBuilder/DashboardContainer.test.tsx
    • superset-frontend/src/dashboard/components/DashboardBuilder/DashboardContainer.tsx
    • superset-frontend/src/dashboard/util/charts/getFormDataWithExtraFilters.ts
    • superset-frontend/src/dashboard/util/getFormDataWithExtraFilters.test.ts
    • superset-frontend/src/dashboard/util/migrateChartCustomization.test.ts
    • superset-frontend/src/dashboard/util/migrateChartCustomization.ts
  • Files skipped - 0
  • Tools
    • Eslint (Linter) - ✔︎ Successful
    • 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

createChartCustomization({ id: customizationId }),
],
});
expectGroupBy(result, ['series_col', 'breakdown_col']);
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.

Incorrect test expectation

The test expects groupby to be ['series_col', 'breakdown_col'], but the current implementation for 'echarts_timeseries_line' charts sets groupby to [groupByColumns[0]], which would be ['series_col']. If the intent is to preserve the multi-column base groupby on overlap, update the implementation; otherwise, correct the expected value.

Code Review Run #24052


Should Bito avoid suggestions like this for future reviews? (Manage Rules)

  • Yes, avoid them

…rtCustomizations

Address PR feedback — use idiomatic truthy filter instead of != null.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@github-actions github-actions bot added 🎪 a04ac8f 🚦 building Environment a04ac8f status: building 🎪 a04ac8f 📅 2026-04-16T21-41 Environment a04ac8f created at 2026-04-16T21-41 🎪 a04ac8f 🤡 sadpandajoe Environment a04ac8f requested by sadpandajoe labels Apr 16, 2026
@github-actions
Copy link
Copy Markdown
Contributor

🎪 Showtime is building environment on GHA for a04ac8f

@github-actions github-actions bot added 🎪 5ac2904 🚦 running Environment 5ac2904 status: running 🎪 🎯 5ac2904 Active environment pointer - 5ac2904 is receiving traffic 🎪 5ac2904 🌐 18.236.112.15:8080 Environment 5ac2904 URL: http://18.236.112.15:8080 (click to visit) and removed 🎪 5ac2904 🚦 deploying Environment 5ac2904 status: deploying 🎪 5ac2904 🚦 running Environment 5ac2904 status: running labels Apr 16, 2026
@github-actions github-actions bot added 🎪 🎯 4794961 Active environment pointer - 4794961 is receiving traffic 🎪 4794961 🌐 54.203.117.226:8080 Environment 4794961 URL: http://54.203.117.226:8080 (click to visit) 🎪 4794961 🚦 running Environment 4794961 status: running and removed 🎪 4794961 🚦 running Environment 4794961 status: running 🎪 🎯 4794961 Active environment pointer - 4794961 is receiving traffic 🎪 a04ac8f 🚦 running Environment a04ac8f status: running 🎪 a04ac8f 🤡 sadpandajoe Environment a04ac8f requested by sadpandajoe 🎪 a04ac8f 🌐 100.23.104.80:8080 Environment a04ac8f URL: http://100.23.104.80:8080 (click to visit) 🎪 a04ac8f 📅 2026-04-16T21-41 Environment a04ac8f created at 2026-04-16T21-41 labels Apr 16, 2026
@github-actions
Copy link
Copy Markdown
Contributor

🎪 Showtime deployed environment on GHA for 4794961

Environment: http://54.203.117.226:8080 (admin/admin)
Lifetime: 48h auto-cleanup
Updates: New commits create fresh environments automatically

@richardfogaca
Copy link
Copy Markdown
Contributor

I pushed a small follow-up for the remaining null-hardening gaps: 5936356437 (fix(dashboard): guard remaining null customization paths).

The normal dashboard API still rejects null entries in chart_customization_config, but the Showtime repro showed [null, validCustomization] could still crash if malformed metadata reached client state through other paths. This follow-up adds the same falsey-entry guard to the remaining raw consumers in nativeFilters/state.ts, chartCustomizationActions.ts, and the CLEAR_ALL_CHART_CUSTOMIZATIONS reducer path in dashboardInfo.ts.

I also added a regression test in state.test.ts that exercises useChartCustomizationConfiguration() with [null, validCustomization] and confirms the valid customization still survives.

@bito-code-review
Copy link
Copy Markdown
Contributor

bito-code-review bot commented Apr 16, 2026

Code Review Agent Run #2e340c

Actionable Suggestions - 0
Review Details
  • Files reviewed - 4 · Commit Range: 5ac2904..4794961
    • superset-frontend/src/dashboard/components/DashboardBuilder/DashboardContainer.tsx
    • superset-frontend/src/dashboard/actions/chartCustomizationActions.ts
    • superset-frontend/src/dashboard/components/DashboardBuilder/DashboardContainer.test.tsx
    • superset-frontend/src/dashboard/reducers/dashboardInfo.ts
  • Files skipped - 0
  • Tools
    • Whispers (Secret Scanner) - ✔︎ Successful
    • Detect-secrets (Secret Scanner) - ✔︎ Successful
    • Eslint (Linter) - ✔︎ 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

# Conflicts:
#	superset-frontend/src/dashboard/actions/chartCustomizationActions.ts
@github-actions github-actions bot added 🎪 15488b5 🚦 building Environment 15488b5 status: building 🎪 15488b5 📅 2026-04-16T22-49 Environment 15488b5 created at 2026-04-16T22-49 🎪 15488b5 🤡 richardfogaca Environment 15488b5 requested by richardfogaca labels Apr 16, 2026
@github-actions
Copy link
Copy Markdown
Contributor

🎪 Showtime is building environment on GHA for 15488b5

@github-actions github-actions bot added 🎪 15488b5 🚦 deploying Environment 15488b5 status: deploying 🎪 15488b5 🚦 running Environment 15488b5 status: running 🎪 🎯 15488b5 Active environment pointer - 15488b5 is receiving traffic 🎪 15488b5 🌐 54.245.15.26:8080 Environment 15488b5 URL: http://54.245.15.26:8080 (click to visit) and removed 🎪 15488b5 🚦 building Environment 15488b5 status: building 🎪 15488b5 🚦 deploying Environment 15488b5 status: deploying 🎪 15488b5 🚦 running Environment 15488b5 status: running 🎪 🎯 15488b5 Active environment pointer - 15488b5 is receiving traffic 🎪 4794961 📅 2026-04-16T22-12 Environment 4794961 created at 2026-04-16T22-12 labels Apr 16, 2026
@github-actions
Copy link
Copy Markdown
Contributor

🎪 Showtime deployed environment on GHA for 15488b5

Environment: http://54.245.15.26:8080 (admin/admin)
Lifetime: 48h auto-cleanup
Updates: New commits create fresh environments automatically

@bito-code-review
Copy link
Copy Markdown
Contributor

bito-code-review bot commented Apr 16, 2026

Code Review Agent Run #befea2

Actionable Suggestions - 0
Review Details
  • Files reviewed - 4 · Commit Range: 4794961..15488b5
    • superset-frontend/src/dashboard/actions/chartCustomizationActions.ts
    • superset-frontend/src/dashboard/components/nativeFilters/state.test.ts
    • superset-frontend/src/dashboard/components/nativeFilters/state.ts
    • superset-frontend/src/dashboard/reducers/dashboardInfo.ts
  • Files skipped - 0
  • Tools
    • Whispers (Secret Scanner) - ✔︎ Successful
    • Detect-secrets (Secret Scanner) - ✔︎ Successful
    • Eslint (Linter) - ✔︎ 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

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 dashboard Namespace | Anything related to the Dashboard size/L 🎪 ⌛ 48h Environment expires after 48 hours (default) 🎪 15488b5 🤡 richardfogaca Environment 15488b5 requested by richardfogaca 🎪 15488b5 🚦 running Environment 15488b5 status: running 🎪 15488b5 🌐 54.245.15.26:8080 Environment 15488b5 URL: http://54.245.15.26:8080 (click to visit) 🎪 15488b5 📅 2026-04-16T22-49 Environment 15488b5 created at 2026-04-16T22-49

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants