You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@superset.apache.org by "DamianPendrak (via GitHub)" <gi...@apache.org> on 2026/01/15 17:43:55 UTC
[PR] fix(chart-customizations) support migration of dynamic group by [superset]
DamianPendrak opened a new pull request, #37176:
URL: https://github.com/apache/superset/pull/37176
<!---
Please write the PR title following the conventions at https://www.conventionalcommits.org/en/v1.0.0/
Example:
fix(dashboard): load charts correctly
-->
### SUMMARY
<!--- Describe the change below, including rationale and design decisions -->
The #36062 introduced changes to support more chart customization types. It does not handle the migration of the old dynamic group by. This is fixed in this PR
### BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
### TESTING INSTRUCTIONS
<!--- Required! What steps can be taken to manually verify the changes? -->
1. Checkout any commit before #36062. For example `481bfa0`
2. Create dynamic group by for any dashboard
3. Checkout to this PR
4. The created dynamic group by should be visible in the sidebar and working properly
### ADDITIONAL INFORMATION
<!--- Check any relevant boxes with "x" -->
<!--- HINT: Include "Fixes #nnn" if you are fixing an existing issue -->
- [ ] Has associated issue:
- [ ] Required feature flags:
- [ ] Changes UI
- [ ] Includes DB Migration (follow approval process in [SIP-59](https://github.com/apache/superset/issues/13351))
- [ ] 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
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [PR] fix(chart-customizations): support migration of dynamic group by [superset]
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #37176:
URL: https://github.com/apache/superset/pull/37176#issuecomment-3829192509
๐ช [Showtime](https://github.com/mistercrunch/superset-showtime) is building environment on [GHA](https://github.com/apache/superset/actions/runs/21549917213) for [e75d556](https://github.com/apache/superset/commit/e75d556)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [PR] fix(chart-customizations) support migration of dynamic group by [superset]
Posted by "codeant-ai-for-open-source[bot] (via GitHub)" <gi...@apache.org>.
codeant-ai-for-open-source[bot] commented on PR #37176:
URL: https://github.com/apache/superset/pull/37176#issuecomment-3756103689
CodeAnt AI is reviewing your PR.
---
### Thanks for using CodeAnt! ๐
We're free for open-source projects. if you're enjoying it, help us grow by sharing.
[Share on X](https://twitter.com/intent/tweet?text=Just%20tried%20%40CodeAntAI%20for%20automated%20code%20review%20and%20I%27m%20impressed%21%20Free%20for%20open%20source%20with%20a%20free%20trial%20for%20private%20repos.%20Worth%20checking%20out%3A&url=https%3A//codeant.ai) ยท
[Reddit](https://www.reddit.com/submit?title=Check%20out%20CodeAnt%20for%20automated%20code%20review&text=Just%20tried%20CodeAnt%20for%20automated%20code%20review%20and%20I%27m%20impressed%21%20Free%20for%20open%20source%20with%20a%20free%20trial%20for%20private%20repos.%20Worth%20checking%20out%3A%20https%3A//codeant.ai) ยท
[LinkedIn](https://www.linkedin.com/sharing/share-offsite/?url=https%3A%2F%2Fcodeant.ai&mini=true&title=Check%20out%20CodeAnt%20for%20automated%20code%20review&summary=Just%20tried%20CodeAnt%20for%20automated%20code%20review%20and%20I%27m%20impressed%21%20Free%20for%20open%20source%20with%20a%20free%20trial%20for%20private%20repos)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [PR] fix(chart-customizations): support migration of dynamic group by [superset]
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #37176:
URL: https://github.com/apache/superset/pull/37176#issuecomment-3756348417
๐ช [Showtime](https://github.com/mistercrunch/superset-showtime) deployed environment on [GHA](https://github.com/apache/superset/actions/runs/21041904112) for [b29ce96](https://github.com/apache/superset/commit/b29ce96)
โข **Environment:** http://44.249.38.210:8080 (admin/admin)
โข **Lifetime:** 48h auto-cleanup
โข **Updates:** New commits create fresh environments automatically
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [PR] fix(chart-customizations): support migration of dynamic group by [superset]
Posted by "bito-code-review[bot] (via GitHub)" <gi...@apache.org>.
bito-code-review[bot] commented on PR #37176:
URL: https://github.com/apache/superset/pull/37176#issuecomment-3904059926
AI Code Review is in progress (usually takes 3 to 15 minutes unless it's a very large PR).
<details>
<summary>
Bito Usage Guide
</summary>
**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 <a href="https://docs.bito.ai/bito-dev-agents/ai-code-review-agent/available-commands" target="_blank" rel="noopener noreferrer">documentation</a> for additional commands.
**Configuration**
This repository uses `Superset` You can customize the agent settings <a href="https://alpha.bito.ai/home/ai-agents/code-review-agent" target="_blank" rel="noopener noreferrer">here</a> or contact your Bito workspace admin at evan@preset.io.
**Documentation & Help**
- <a href="https://docs.bito.ai/bito-dev-agents/ai-code-review-agent/getting-started/install-run-using-bito-cloud/create-or-customize-an-agent-instance" target="_blank" rel="noopener noreferrer">Customize agent settings</a>
- <a href="https://docs.bito.ai/bito-dev-agents/ai-code-review-agent/implementing-custom-code-review-rules" target="_blank" rel="noopener noreferrer">Review rules</a>
- <a href="https://docs.bito.ai/bito-dev-agents/ai-code-review-agent" target="_blank" rel="noopener noreferrer">General documentation</a>
- <a href="https://docs.bito.ai/bito-dev-agents/ai-code-review-agent/faqs" target="_blank" rel="noopener noreferrer">FAQ</a>
</details>
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [PR] fix(chart-customizations): support migration of dynamic group by [superset]
Posted by "bito-code-review[bot] (via GitHub)" <gi...@apache.org>.
bito-code-review[bot] commented on PR #37176:
URL: https://github.com/apache/superset/pull/37176#issuecomment-3756407296
AI Code Review is in progress (usually takes 3 to 15 minutes unless it's a very large PR).
<details>
<summary>
Bito Usage Guide
</summary>
**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 <a href="https://docs.bito.ai/bito-dev-agents/ai-code-review-agent/available-commands" target="_blank" rel="noopener noreferrer">documentation</a> for additional commands.
**Configuration**
This repository uses `Superset` You can customize the agent settings <a href="https://alpha.bito.ai/home/ai-agents/code-review-agent" target="_blank" rel="noopener noreferrer">here</a> or contact your Bito workspace admin at evan@preset.io.
**Documentation & Help**
- <a href="https://docs.bito.ai/bito-dev-agents/ai-code-review-agent/getting-started/install-run-using-bito-cloud/create-or-customize-an-agent-instance" target="_blank" rel="noopener noreferrer">Customize agent settings</a>
- <a href="https://docs.bito.ai/bito-dev-agents/ai-code-review-agent/implementing-custom-code-review-rules" target="_blank" rel="noopener noreferrer">Review rules</a>
- <a href="https://docs.bito.ai/bito-dev-agents/ai-code-review-agent" target="_blank" rel="noopener noreferrer">General documentation</a>
- <a href="https://docs.bito.ai/bito-dev-agents/ai-code-review-agent/faqs" target="_blank" rel="noopener noreferrer">FAQ</a>
</details>
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [PR] fix(chart-customizations): support migration of dynamic group by [superset]
Posted by "dosubot[bot] (via GitHub)" <gi...@apache.org>.
dosubot[bot] commented on PR #37176:
URL: https://github.com/apache/superset/pull/37176#issuecomment-3937178856
<!-- Answer -->
**Related Documentation**
Checked 0 published document(s) in 2 knowledge base(s). No updates required.
<!-- Dosu Comment Footer -->
<sup>How did I do? Any feedback?</sup> [](https://go.dosu.dev/discord-bot)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [PR] fix(chart-customizations): support migration of dynamic group by [superset]
Posted by "sadpandajoe (via GitHub)" <gi...@apache.org>.
sadpandajoe merged PR #37176:
URL: https://github.com/apache/superset/pull/37176
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [PR] fix(chart-customizations): support migration of dynamic group by [superset]
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #37176:
URL: https://github.com/apache/superset/pull/37176#issuecomment-3843363565
@sadpandajoe Ephemeral environment spinning up at http://54.214.116.16:8080. Credentials are 'admin'/'admin'. Please allow several minutes for bootstrapping and startup.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [PR] fix(chart-customizations): support migration of dynamic group by [superset]
Posted by "netlify[bot] (via GitHub)" <gi...@apache.org>.
netlify[bot] commented on PR #37176:
URL: https://github.com/apache/superset/pull/37176#issuecomment-3756118929
### <span aria-hidden="true">โ
</span> Deploy Preview for *superset-docs-preview* ready!
| Name | Link |
|:-:|------------------------|
|<span aria-hidden="true">๐จ</span> Latest commit | d128507eb00f21fed173bf5f6c1577ba207c5953 |
|<span aria-hidden="true">๐</span> Latest deploy log | https://app.netlify.com/projects/superset-docs-preview/deploys/6969275b682be8000877e073 |
|<span aria-hidden="true">๐</span> Deploy Preview | [https://deploy-preview-37176--superset-docs-preview.netlify.app](https://deploy-preview-37176--superset-docs-preview.netlify.app) |
|<span aria-hidden="true">๐ฑ</span> Preview on mobile | <details><summary> Toggle QR Code... </summary><br /><br /><br /><br />_Use your smartphone camera to open QR code link._</details> |
---
<!-- [superset-docs-preview Preview](https://deploy-preview-37176--superset-docs-preview.netlify.app) -->
_To edit notification comments on pull requests, go to your [Netlify project configuration](https://app.netlify.com/projects/superset-docs-preview/configuration/notifications#deploy-notifications)._
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [PR] fix(chart-customizations): support migration of dynamic group by [superset]
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #37176:
URL: https://github.com/apache/superset/pull/37176#issuecomment-3829228901
๐ช [Showtime](https://github.com/mistercrunch/superset-showtime) deployed environment on [GHA](https://github.com/apache/superset/actions/runs/21549917213) for [e75d556](https://github.com/apache/superset/commit/e75d556)
โข **Environment:** http://35.93.128.118:8080 (admin/admin)
โข **Lifetime:** 72h auto-cleanup
โข **Updates:** New commits create fresh environments automatically
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [PR] fix(chart-customizations): support migration of dynamic group by [superset]
Posted by "DamianPendrak (via GitHub)" <gi...@apache.org>.
DamianPendrak commented on code in PR #37176:
URL: https://github.com/apache/superset/pull/37176#discussion_r2695397752
##########
superset-frontend/src/dataMask/reducer.ts:
##########
@@ -216,9 +220,17 @@ const dataMaskReducer = produce(
loadedDataMask,
);
- const chartCustomizationConfig =
+ const rawChartCustomizationConfig =
metadata?.chart_customization_config || [];
+ const hasLegacyFormat = rawChartCustomizationConfig.some(item =>
+ isLegacyChartCustomizationFormat(item),
+ );
+
+ const chartCustomizationConfig = hasLegacyFormat
+ ? migrateChartCustomizationArray(rawChartCustomizationConfig)
+ : (rawChartCustomizationConfig as ChartCustomization[]);
Review Comment:
migrateChartCustomizationArray checks if the item is legacy and only then migrates it
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [PR] fix(chart-customizations): support migration of dynamic group by [superset]
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #37176:
URL: https://github.com/apache/superset/pull/37176#issuecomment-3843323493
โ ๏ธ **DEPRECATED WORKFLOW** โ ๏ธ
@sadpandajoe This workflow is deprecated! Please use the new **Superset Showtime** system instead:
- Replace "testenv-up" label with "๐ช trigger-start"
- Better reliability and easier management
- See https://github.com/mistercrunch/superset-showtime for details
Processing your ephemeral environment request [here](https://github.com/apache/superset/actions/runs/21645288648). Action: **up**. More information on [how to use or configure ephemeral environments](https://superset.apache.org/docs/contributing/howtos/#github-ephemeral-environments)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [PR] fix(chart-customizations): support migration of dynamic group by [superset]
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #37176:
URL: https://github.com/apache/superset/pull/37176#issuecomment-3756278964
๐ช [Showtime](https://github.com/mistercrunch/superset-showtime) is building environment on [GHA](https://github.com/apache/superset/actions/runs/21041904112) for [b29ce96](https://github.com/apache/superset/commit/b29ce96)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [PR] fix(chart-customizations): support migration of dynamic group by [superset]
Posted by "codeant-ai-for-open-source[bot] (via GitHub)" <gi...@apache.org>.
codeant-ai-for-open-source[bot] commented on PR #37176:
URL: https://github.com/apache/superset/pull/37176#issuecomment-3756128728
CodeAnt AI finished reviewing your PR.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [PR] fix(chart-customizations): support migration of dynamic group by [superset]
Posted by "rebecanogueira-preset (via GitHub)" <gi...@apache.org>.
rebecanogueira-preset commented on PR #37176:
URL: https://github.com/apache/superset/pull/37176#issuecomment-3871930183
@DamianPendrak has this been tested yet or do you need QA validation for this PR?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [PR] fix(chart-customizations): support migration of dynamic group by [superset]
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #37176:
URL: https://github.com/apache/superset/pull/37176#issuecomment-3756285336
๐ช [Showtime](https://github.com/mistercrunch/superset-showtime) is building environment on [GHA](https://github.com/apache/superset/actions/runs/21041964517) for [e75d556](https://github.com/apache/superset/commit/e75d556)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [PR] fix(chart-customizations): support migration of dynamic group by [superset]
Posted by "codeant-ai-for-open-source[bot] (via GitHub)" <gi...@apache.org>.
codeant-ai-for-open-source[bot] commented on code in PR #37176:
URL: https://github.com/apache/superset/pull/37176#discussion_r2695382414
##########
superset-frontend/src/dashboard/components/nativeFilters/state.ts:
##########
@@ -96,8 +100,16 @@ const selectChartCustomizationConfiguration = createSelector(
state.dashboardInfo.metadata?.chart_customization_config || EMPTY_ARRAY,
selectDashboardChartIds,
Review Comment:
**Suggestion:** The selector accesses `state.dashboardInfo.metadata` without checking whether `state.dashboardInfo` exists; if `dashboardInfo` is undefined this will throw at runtime. Add optional chaining on `dashboardInfo` so the selector safely falls back to `EMPTY_ARRAY` when `dashboardInfo` is not present. [null pointer]
<details>
<summary><b>Severity Level:</b> Critical ๐จ</summary>
```mdx
- โ Dashboard render crashes on missing dashboardInfo.
- โ Chart customizations sidebar fails to mount.
- โ ๏ธ Unit tests mocking partial store may fail.
```
</details>
```suggestion
state.dashboardInfo?.metadata?.chart_customization_config || EMPTY_ARRAY,
```
<details>
<summary><b>Steps of Reproduction โ
</b></summary>
```mdx
1. Open the dashboard UI component that uses chart customizations which calls
useChartCustomizationConfiguration (see useChartCustomizationConfiguration at
superset-frontend/src/dashboard/components/nativeFilters/state.ts:127).
2. During initial render the selector selectChartCustomizationConfiguration is executed
(defined at superset-frontend/src/dashboard/components/nativeFilters/state.ts:100-101).
3. If Redux state has no dashboardInfo key (state.dashboardInfo === undefined) the
expression at superset-frontend/src/dashboard/components/nativeFilters/state.ts:101
attempts to read `.metadata` on undefined and throws a TypeError.
4. Reproduce in tests by mocking react-redux useSelector to return a store object without
dashboardInfo and rendering any component that calls useChartCustomizationConfiguration;
the component render will throw at the selector line shown above.
```
</details>
<details>
<summary><b>Prompt for AI Agent ๐ค </b></summary>
```mdx
This is a comment left during a code review.
**Path:** superset-frontend/src/dashboard/components/nativeFilters/state.ts
**Line:** 101:101
**Comment:**
*Null Pointer: The selector accesses `state.dashboardInfo.metadata` without checking whether `state.dashboardInfo` exists; if `dashboardInfo` is undefined this will throw at runtime. Add optional chaining on `dashboardInfo` so the selector safely falls back to `EMPTY_ARRAY` when `dashboardInfo` is not present.
Validate the correctness of the flagged issue. If correct, How can I resolve this? If you propose a fix, implement it and please make it concise.
```
</details>
##########
superset-frontend/src/dataMask/reducer.ts:
##########
@@ -216,9 +220,17 @@ const dataMaskReducer = produce(
loadedDataMask,
);
- const chartCustomizationConfig =
+ const rawChartCustomizationConfig =
metadata?.chart_customization_config || [];
+ const hasLegacyFormat = rawChartCustomizationConfig.some(item =>
+ isLegacyChartCustomizationFormat(item),
+ );
+
+ const chartCustomizationConfig = hasLegacyFormat
+ ? migrateChartCustomizationArray(rawChartCustomizationConfig)
+ : (rawChartCustomizationConfig as ChartCustomization[]);
Review Comment:
**Suggestion:** Logic bug / unsafe migration: when any legacy item exists the code calls `migrateChartCustomizationArray` with the entire `rawChartCustomizationConfig` (including already-modern items), potentially re-migrating or corrupting items that are already in the new format; instead, migrate only legacy items and preserve existing new items (while keeping original order). [possible bug]
<details>
<summary><b>Severity Level:</b> Critical ๐จ</summary>
```mdx
- โ Dashboard hydration can corrupt chart customization entries.
- โ Sidebar chart customization shows incorrect items.
- โ ๏ธ Affects dashboards with mixed-format customization arrays.
- โ ๏ธ Migration may alter saved dashboard configuration.
```
</details>
```suggestion
// Migrate only legacy items and preserve non-legacy items in original order.
const legacyItems = rawChartCustomizationConfig.filter(item =>
isLegacyChartCustomizationFormat(item),
);
const migratedLegacyItems = legacyItems.length
? migrateChartCustomizationArray(legacyItems)
: [];
// Reconstruct final array preserving order: replace legacy entries with migrated ones.
let migratedIndex = 0;
const chartCustomizationConfig = rawChartCustomizationConfig.map(item =>
isLegacyChartCustomizationFormat(item)
? (migratedLegacyItems[migratedIndex++] as ChartCustomization)
: (item as ChartCustomization),
);
```
<details>
<summary><b>Steps of Reproduction โ
</b></summary>
```mdx
1. Open the dashboard page that triggers dashboard hydration. The HYDRATE_DASHBOARD action
is handled by the reducer at superset-frontend/src/dataMask/reducer.ts in the
HYDRATE_DASHBOARD case (lines ~220-320). The migration code runs at lines 223-232 in that
file.
2. Ensure the dashboard metadata returned from the backend includes
chart_customization_config with a mix of legacy-format and already-modern-format items
(the reducer reads metadata?.chart_customization_config at line 223).
3. When the HYDRATE_DASHBOARD action is dispatched, the reducer evaluates hasLegacyFormat
using isLegacyChartCustomizationFormat (imported from
src/dashboard/util/migrateChartCustomization) at lines 226-228.
4. Because at least one legacy item exists, the current code calls
migrateChartCustomizationArray with the entire rawChartCustomizationConfig array (line
231). If migrateChartCustomizationArray expects legacy-only inputs or transforms items
generically, this will re-process modern items and can change/corrupt them. Observe
unexpected/mutated chart customization entries after hydration in the dashboard UI
(sidebar customizations missing or altered), originating from reducer lines 223-232.
Note: This reproduces concretely by creating a dashboard metadata payload containing
mixed-format chart_customization_config and loading that dashboard so the
HYDRATE_DASHBOARD reducer branch executes (see reducer.ts lines 220-236).
```
</details>
<details>
<summary><b>Prompt for AI Agent ๐ค </b></summary>
```mdx
This is a comment left during a code review.
**Path:** superset-frontend/src/dataMask/reducer.ts
**Line:** 226:232
**Comment:**
*Possible Bug: Logic bug / unsafe migration: when any legacy item exists the code calls `migrateChartCustomizationArray` with the entire `rawChartCustomizationConfig` (including already-modern items), potentially re-migrating or corrupting items that are already in the new format; instead, migrate only legacy items and preserve existing new items (while keeping original order).
Validate the correctness of the flagged issue. If correct, How can I resolve this? If you propose a fix, implement it and please make it concise.
```
</details>
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [PR] fix(chart-customizations) support migration of dynamic group by [superset]
Posted by "bito-code-review[bot] (via GitHub)" <gi...@apache.org>.
bito-code-review[bot] commented on PR #37176:
URL: https://github.com/apache/superset/pull/37176#issuecomment-3756104157
AI Code Review is in progress (usually takes 3 to 15 minutes unless it's a very large PR).
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [PR] fix(chart-customizations): support migration of dynamic group by [superset]
Posted by "DamianPendrak (via GitHub)" <gi...@apache.org>.
DamianPendrak commented on PR #37176:
URL: https://github.com/apache/superset/pull/37176#issuecomment-3889723428
@rebecanogueira-preset I need QA validation for this PR
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org