You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@superset.apache.org by "SBIN2010 (via GitHub)" <gi...@apache.org> on 2026/08/09 21:43:03 UTC

[PR] feat: add conditional formating to CountryMap plugin [superset]

SBIN2010 opened a new pull request, #42941:
URL: https://github.com/apache/superset/pull/42941

   <!---
   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 -->
   
   Implementation of the conditional formatting functionality for the country map proposed in the PR #36732.
   
   ### BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
   <!--- Skip this if not applicable -->
   <img width="1888" height="1099" alt="Снимок экрана от 2026-08-10 00-42-26" src="https://github.com/user-attachments/assets/64af09e9-c271-41a3-871e-1aedf3746536" />
   
   ### TESTING INSTRUCTIONS
   <!--- Required! What steps can be taken to manually verify the changes? -->
   
   ### 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] feat: add conditional formating to CountryMap plugin [superset]

Posted by "bito-code-review[bot] (via GitHub)" <gi...@apache.org>.
bito-code-review[bot] commented on PR #42941:
URL: https://github.com/apache/superset/pull/42941#issuecomment-5287875703

   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] feat: add conditional formating to CountryMap plugin [superset]

Posted by "bito-code-review[bot] (via GitHub)" <gi...@apache.org>.
bito-code-review[bot] commented on PR #42941:
URL: https://github.com/apache/superset/pull/42941#issuecomment-5274254412

   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] feat: add conditional formating to CountryMap plugin [superset]

Posted by "bito-code-review[bot] (via GitHub)" <gi...@apache.org>.
bito-code-review[bot] commented on code in PR #42941:
URL: https://github.com/apache/superset/pull/42941#discussion_r3745422997


##########
superset-frontend/plugins/plugin-chart-country-map/src/controlPanel.ts:
##########
@@ -71,6 +72,36 @@ const config: ControlPanelConfig = {
         ],
         ['currency_format'],
         ['linear_color_scheme'],
+        [
+          {
+            name: 'conditional_formatting',
+            config: {
+              type: 'ConditionalFormattingControl',
+              renderTrigger: true,
+              label: t('Custom conditional formatting'),
+              description: t(
+                'Apply conditional color formatting to numeric columns',
+              ),
+              shouldMapStateToProps() {
+                return true;
+              },
+              mapStateToProps(_, chart) {
+                const chartStatus = chart?.chartStatus;
+                const columnOptions = [
+                  {
+                    value: 'metric',
+                    label: 'metric',
+                    dataType: GenericDataType.Numeric,
+                  },
+                ];
+                return {
+                  removeIrrelevantConditions: chartStatus === 'success',
+                  columnOptions,
+                };
+              },
+            },
+          },
+        ],

Review Comment:
   <!-- Bito Reply -->
   The suggestion is valid because `ConditionalFormattingControl` explicitly requires `verboseMap` as a prop. Even if the component handles the absence of `verboseMap` internally, providing it ensures the control functions as expected and avoids potential runtime errors or unexpected behavior in the plugin's configuration.



-- 
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] feat: add conditional formating to CountryMap plugin [superset]

Posted by "netlify[bot] (via GitHub)" <gi...@apache.org>.
netlify[bot] commented on PR #42941:
URL: https://github.com/apache/superset/pull/42941#issuecomment-5233997117

   ### <span aria-hidden="true">✅</span> Deploy Preview for *superset-docs-preview* ready!
   
   
   |  Name | Link |
   |:-:|------------------------|
   |<span aria-hidden="true">🔨</span> Latest commit | 7cadfc639d26c8bd9ee4b83d22c43a4157cff510 |
   |<span aria-hidden="true">🔍</span> Latest deploy log | https://app.netlify.com/projects/superset-docs-preview/deploys/6a78f46730149e00087880f2 |
   |<span aria-hidden="true">😎</span> Deploy Preview | [https://deploy-preview-42941--superset-docs-preview.netlify.app](https://deploy-preview-42941--superset-docs-preview.netlify.app) |
   |<span aria-hidden="true">📱</span> Preview on mobile | <details><summary> Toggle QR Code... </summary><br /><br />![QR Code](https://app.netlify.com/qr-code/eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1cmwiOiJodHRwczovL2RlcGxveS1wcmV2aWV3LTQyOTQxLS1zdXBlcnNldC1kb2NzLXByZXZpZXcubmV0bGlmeS5hcHAifQ.-_4HBmtNlsFzfAB-jNSac7647KDdj_DO0SQCLLV-j3o)<br /><br />_Use your smartphone camera to open QR code link._</details> |
   |<span aria-hidden="true">🤖</span> Make changes | [Run an agent on this branch](https://app.netlify.com/projects/superset-docs-preview/agent-runs#FctRCsIwDIDhu-RZMOpYqzfwFCUu7SysSQnxYYh3t3v74ef7Qjdt3eEBcIKXkSzv0SWTfyyfiTktKly9qtCWilojr7KmKsdw21OjPijnvun-5IFnCrFMc7jhZbpnRIwhRixX-P0B) |
   ---
   <!-- [superset-docs-preview Preview](https://deploy-preview-42941--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] feat: add conditional formating to CountryMap plugin [superset]

Posted by "bito-code-review[bot] (via GitHub)" <gi...@apache.org>.
bito-code-review[bot] commented on PR #42941:
URL: https://github.com/apache/superset/pull/42941#issuecomment-5233991050

   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] feat: add conditional formating to CountryMap plugin [superset]

Posted by "bito-code-review[bot] (via GitHub)" <gi...@apache.org>.
bito-code-review[bot] commented on code in PR #42941:
URL: https://github.com/apache/superset/pull/42941#discussion_r3745410291


##########
superset-frontend/plugins/plugin-chart-country-map/src/controlPanel.ts:
##########
@@ -71,6 +72,36 @@ const config: ControlPanelConfig = {
         ],
         ['currency_format'],
         ['linear_color_scheme'],
+        [
+          {
+            name: 'conditional_formatting',
+            config: {
+              type: 'ConditionalFormattingControl',
+              renderTrigger: true,
+              label: t('Custom conditional formatting'),
+              description: t(
+                'Apply conditional color formatting to numeric columns',
+              ),
+              shouldMapStateToProps() {
+                return true;
+              },
+              mapStateToProps(_, chart) {
+                const chartStatus = chart?.chartStatus;
+                const columnOptions = [
+                  {
+                    value: 'metric',
+                    label: 'metric',
+                    dataType: GenericDataType.Numeric,
+                  },
+                ];
+                return {
+                  removeIrrelevantConditions: chartStatus === 'success',
+                  columnOptions,
+                };
+              },
+            },
+          },
+        ],

Review Comment:
   <div>
   
   
   <div id="suggestion">
   <div id="issue"><b>Missing verboseMap prop</b></div>
   <div id="fix">
   
   Add the required `verboseMap` property to the object returned by `mapStateToProps`, similar to other plugins, so that `ConditionalFormattingControl` receives its required prop and does not crash.
   </div>
   
   
   </div>
   
   
   
   
   <small><i>Code Review Run #3192dd</i></small>
   </div>
   
   ---
   Should Bito avoid suggestions like this for future reviews? (<a href=https://alpha.bito.ai/home/ai-agents/review-rules>Manage Rules</a>)
   - [ ] Yes, avoid them



-- 
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] feat: add conditional formating to CountryMap plugin [superset]

Posted by "bito-code-review[bot] (via GitHub)" <gi...@apache.org>.
bito-code-review[bot] commented on code in PR #42941:
URL: https://github.com/apache/superset/pull/42941#discussion_r3745410291


##########
superset-frontend/plugins/plugin-chart-country-map/src/controlPanel.ts:
##########
@@ -71,6 +72,36 @@ const config: ControlPanelConfig = {
         ],
         ['currency_format'],
         ['linear_color_scheme'],
+        [
+          {
+            name: 'conditional_formatting',
+            config: {
+              type: 'ConditionalFormattingControl',
+              renderTrigger: true,
+              label: t('Custom conditional formatting'),
+              description: t(
+                'Apply conditional color formatting to numeric columns',
+              ),
+              shouldMapStateToProps() {
+                return true;
+              },
+              mapStateToProps(_, chart) {
+                const chartStatus = chart?.chartStatus;
+                const columnOptions = [
+                  {
+                    value: 'metric',
+                    label: 'metric',
+                    dataType: GenericDataType.Numeric,
+                  },
+                ];
+                return {
+                  removeIrrelevantConditions: chartStatus === 'success',
+                  columnOptions,
+                };
+              },
+            },
+          },
+        ],

Review Comment:
   <div>
   
   
   <div id="suggestion">
   <div id="issue"><b>Missing verboseMap prop</b></div>
   <div id="fix">
   
   Add the required `verboseMap` property to the object returned by `mapStateToProps`, similar to other plugins, so that `ConditionalFormattingControl` receives its required prop and does not crash.
   </div>
   
   
   </div>
   
   
   
   
   <small><i>Code Review Run #3192dd</i></small>
   </div><div>
   
   
   <div id="suggestion">
   <div id="issue"><b>Hardcoded columnOptions breaks control</b></div>
   <div id="fix">
   
   The `columnOptions` is hardcoded to only `[{ value: 'metric', label: 'metric' }]`, making all real data columns inaccessible in the conditional formatting UI. Compare with the working pattern in `BigNumberTotal/controlPanel.ts:101-118` which extracts `colnames`/`coltypes` from `chart?.queriesResponse?.[0]` and dynamically builds options filtered by `GenericDataType.Numeric`.
   </div>
   
   
   </div>
   
   
   
   
   <small><i>Code Review Run #608927</i></small>
   </div>
   
   ---
   Should Bito avoid suggestions like this for future reviews? (<a href=https://alpha.bito.ai/home/ai-agents/review-rules>Manage Rules</a>)
   - [ ] Yes, avoid them



-- 
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] feat: add conditional formating to CountryMap plugin [superset]

Posted by "SBIN2010 (via GitHub)" <gi...@apache.org>.
SBIN2010 commented on PR #42941:
URL: https://github.com/apache/superset/pull/42941#issuecomment-5287098031

   Hi @rusackas!
   Thanks for the detailed review.
   I made some changes, slightly altering the approach, and added tests.
   


-- 
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] feat: add conditional formating to CountryMap plugin [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 #42941:
URL: https://github.com/apache/superset/pull/42941#discussion_r3745395412


##########
superset-frontend/plugins/plugin-chart-country-map/src/CountryMap.ts:
##########
@@ -128,6 +131,18 @@ function CountryMap(element: HTMLElement, props: CountryMapProps) {
 
   const colorFn = (feature: GeoFeature): string => {
     if (!feature?.properties) return '#d9d9d9';
+    const regionData = data.find(
+      region => region.country_id === feature.properties.ISO,
+    );

Review Comment:
   **Suggestion:** Each geographic feature performs a linear search through all query rows before applying conditional formatting. This changes rendering to O(features × rows), while `colorMap` already provides an O(1) lookup; large regional maps can therefore incur substantial rendering and interaction stalls. Build a country-to-row or country-to-metric map once before defining `colorFn`. [performance]
   
   <details>
   <summary><b>Severity Level:</b> Major ⚠️</summary>
   
   ```mdx
   - ⚠️ Large regional maps perform quadratic color lookups.
   - ⚠️ Initial rendering and interactions may stall.
   - ⚠️ Conditional formatting redraws repeat the same searches.
   ```
   </details>
   
   [![Fix in Cursor](https://new-codeant-butcket.s3.us-west-1.amazonaws.com/badges/fix-in-cursor-flat.svg)](https://app.codeant.ai/fix-in-ide?tool=cursor&prompt_id=5d57ffaecc4947e594533ba96c844a8f&service=github&base_url=https%3A%2F%2Fgithub.com&org=apache&repo=apache%2Fsuperset) [![Fix in VSCode Claude](https://new-codeant-butcket.s3.us-west-1.amazonaws.com/badges/fix-in-vscode-claude-flat.svg)](https://app.codeant.ai/fix-in-ide?tool=vscode-claude&prompt_id=5d57ffaecc4947e594533ba96c844a8f&service=github&base_url=https%3A%2F%2Fgithub.com&org=apache&repo=apache%2Fsuperset)
   <details>
   <summary><b>Prompt for AI Agent 🤖 </b></summary>
   
   ```mdx
   This is a comment left during a code review.
   
   **Path:** superset-frontend/plugins/plugin-chart-country-map/src/CountryMap.ts
   **Line:** 134:136
   **Comment:**
   	*Performance: Each geographic feature performs a linear search through all query rows before applying conditional formatting. This changes rendering to O(features × rows), while `colorMap` already provides an O(1) lookup; large regional maps can therefore incur substantial rendering and interaction stalls. Build a country-to-row or country-to-metric map once before defining `colorFn`.
   
   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.
   Once fix is implemented, also check other comments on the same PR, and ask user if the user wants to fix the rest of the comments as well. if said yes, then fetch all the comments validate the correctness and implement a minimal fix
   ```
   </details>
   <a href='https://app.codeant.ai/feedback?pr_url=https%3A%2F%2Fgithub.com%2Fapache%2Fsuperset%2Fpull%2F42941&comment_hash=560dd9f8a541eec199b80903359687f481fdc96e660fb9d757a905c9075f5362&reaction=like'>👍</a> | <a href='https://app.codeant.ai/feedback?pr_url=https%3A%2F%2Fgithub.com%2Fapache%2Fsuperset%2Fpull%2F42941&comment_hash=560dd9f8a541eec199b80903359687f481fdc96e660fb9d757a905c9075f5362&reaction=dislike'>👎</a>



-- 
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] feat: add conditional formating to CountryMap plugin [superset]

Posted by "bito-code-review[bot] (via GitHub)" <gi...@apache.org>.
bito-code-review[bot] commented on code in PR #42941:
URL: https://github.com/apache/superset/pull/42941#discussion_r3972987791


##########
superset-frontend/plugins/plugin-chart-country-map/src/transformProps.ts:
##########
@@ -64,6 +67,7 @@ export default function transformProps(chartProps: ChartProps) {
       ? { country_id: row[entityLabel], metric: row[metricLabel] }
       : row,
   );
+  const formatters = getColorFormatters(conditionalFormatting, data, theme);

Review Comment:
   <!-- Bito Reply -->
   The suggestion to add test coverage for the new formatters is appropriate. Since the code now includes a test asserting the `transformed.formatters` output, the concern raised by the reviewer has been addressed.



-- 
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] feat: add conditional formating to CountryMap plugin [superset]

Posted by "SBIN2010 (via GitHub)" <gi...@apache.org>.
SBIN2010 commented on PR #42941:
URL: https://github.com/apache/superset/pull/42941#issuecomment-5273511613

   /review


-- 
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] feat: add conditional formating to CountryMap plugin [superset]

Posted by "bito-code-review[bot] (via GitHub)" <gi...@apache.org>.
bito-code-review[bot] commented on PR #42941:
URL: https://github.com/apache/superset/pull/42941#issuecomment-5287875461

   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] feat: add conditional formating to CountryMap plugin [superset]

Posted by "Copilot (via GitHub)" <gi...@apache.org>.
Copilot commented on code in PR #42941:
URL: https://github.com/apache/superset/pull/42941#discussion_r3908673686


##########
superset-frontend/plugins/plugin-chart-country-map/src/CountryMap.ts:
##########
@@ -81,6 +82,7 @@ interface CountryMapProps {
     };
   };
   entity?: string;
+  formatters?: ColorFormatters[];

Review Comment:
   `ColorFormatters` is already the array type (`packages/superset-ui-chart-controls/src/types.ts:506-515`). Adding another `[]` makes each loop item an array, so `colorFormatter.getColorFromValue(...)` below fails type checking. Use the alias directly.



##########
superset-frontend/plugins/plugin-chart-country-map/test/CountryMap.test.tsx:
##########
@@ -74,6 +76,35 @@ const mockMapData = {
 
 type D3JsonCallback = (error: Error | null, data: unknown) => void;
 
+function expectedLinearFill(
+  data: { metric: number }[],
+  linearColorScheme: string,
+): string {
+  const rawExtents = d3Extent(data, v => v.metric);
+  const extents: [number, number] =
+    rawExtents[0] != null && rawExtents[1] != null
+      ? [rawExtents[0], rawExtents[1]]
+      : [0, 1];
+  const colorSchemeObj = getSequentialSchemeRegistry().get(linearColorScheme);
+  const linearColorScale = colorSchemeObj
+    ? colorSchemeObj.createLinearScale(extents)
+    : () => '#ccc';
+  return linearColorScale(data[0].metric) ?? '#ccc';
+}
+
+function expectFillToMatchLinearScheme(
+  region: Element | null,
+  data: { metric: number }[],

Review Comment:
   This parameter contextually types the inline fixtures as objects containing only `metric`, but both new callers also provide `country_id`; TypeScript's excess-property check rejects those calls. Type the helper with the actual CountryMap data shape.
   
   This issue also appears on line 281 of the same file.



-- 
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] feat: add conditional formating to CountryMap plugin [superset]

Posted by "bito-code-review[bot] (via GitHub)" <gi...@apache.org>.
bito-code-review[bot] commented on PR #42941:
URL: https://github.com/apache/superset/pull/42941#issuecomment-5286769764

   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] feat: add conditional formating to CountryMap plugin [superset]

Posted by "bito-code-review[bot] (via GitHub)" <gi...@apache.org>.
bito-code-review[bot] commented on PR #42941:
URL: https://github.com/apache/superset/pull/42941#issuecomment-5234786827

   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] feat: add conditional formating to CountryMap plugin [superset]

Posted by "SBIN2010 (via GitHub)" <gi...@apache.org>.
SBIN2010 merged PR #42941:
URL: https://github.com/apache/superset/pull/42941


-- 
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] feat: add conditional formating to CountryMap plugin [superset]

Posted by "bito-code-review[bot] (via GitHub)" <gi...@apache.org>.
bito-code-review[bot] commented on PR #42941:
URL: https://github.com/apache/superset/pull/42941#issuecomment-5234011348

   <!-- Bito Reply -->
   The performance issue identified is correct. The current implementation performs a linear search (`data.find`) inside the `colorFn` function, which is called for every geographic feature during rendering, leading to O(features × rows) complexity.
   
   To resolve this, you can pre-process the data into a Map for O(1) lookups before defining `colorFn`.
   
   ### Proposed Fix
   
   In `superset-frontend/plugins/plugin-chart-country-map/src/CountryMap.ts`, update the `CountryMap` function to create a lookup map:
   
   ```typescript
     const regionMap = useMemo(() => 
       new Map(data.map(region => [region.country_id, region])),
     [data]);
   
     const colorFn = (feature: GeoFeature): string => {
       if (!feature?.properties) return '#d9d9d9';
       const regionData = regionMap.get(feature.properties.ISO);
   
       if (regionData && formatters?.length > 0) {
         for (const formatter of formatters) {
           const cfColor = formatter.getColorFromValue(regionData.metric);
           if (cfColor) return cfColor;
         }
       }
       return colorMap[feature.properties.ISO] || '#d9d9d9';
     };
   ```
   
   This change ensures that lookups are efficient. Would you like me to check the rest of the comments on this PR to see if there are other issues to address?
   
   **superset-frontend/plugins/plugin-chart-country-map/src/CountryMap.ts**
   ```
   const regionMap = useMemo(() => 
       new Map(data.map(region => [region.country_id, region])),
     [data]);
   
     const colorFn = (feature: GeoFeature): string => {
       if (!feature?.properties) return '#d9d9d9';
       const regionData = regionMap.get(feature.properties.ISO);
   
       if (regionData && formatters?.length > 0) {
         for (const formatter of formatters) {
           const cfColor = formatter.getColorFromValue(regionData.metric);
           if (cfColor) return cfColor;
         }
       }
       return colorMap[feature.properties.ISO] || '#d9d9d9';
     };
   ```


-- 
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] feat: add conditional formating to CountryMap plugin [superset]

Posted by "bito-code-review[bot] (via GitHub)" <gi...@apache.org>.
bito-code-review[bot] commented on PR #42941:
URL: https://github.com/apache/superset/pull/42941#issuecomment-5273512669

   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] feat: add conditional formating to CountryMap plugin [superset]

Posted by "bito-code-review[bot] (via GitHub)" <gi...@apache.org>.
bito-code-review[bot] commented on code in PR #42941:
URL: https://github.com/apache/superset/pull/42941#discussion_r3770843537


##########
superset-frontend/plugins/plugin-chart-country-map/src/transformProps.ts:
##########
@@ -64,6 +67,7 @@ export default function transformProps(chartProps: ChartProps) {
       ? { country_id: row[entityLabel], metric: row[metricLabel] }
       : row,
   );
+  const formatters = getColorFormatters(conditionalFormatting, data, theme);

Review Comment:
   <div>
   
   
   <div id="suggestion">
   <div id="issue"><b>Missing test coverage for formatters</b></div>
   <div id="fix">
   
   The new `formatters` output is not verified in existing tests. Per BITO.md rule [6262], tests should verify actual business logic — adding a mock for `getColorFormatters` (pattern used in `BigNumberTotal/transformProps.test.ts`) and asserting `formatters` appears in output would prevent regressions.
   </div>
   
   
   </div>
   
   
   
   
   <small><i>Code Review Run #af12a7</i></small>
   </div>
   
   ---
   Should Bito avoid suggestions like this for future reviews? (<a href=https://alpha.bito.ai/home/ai-agents/review-rules>Manage Rules</a>)
   - [ ] Yes, avoid them



-- 
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] feat: add conditional formating to CountryMap plugin [superset]

Posted by "Copilot (via GitHub)" <gi...@apache.org>.
Copilot commented on code in PR #42941:
URL: https://github.com/apache/superset/pull/42941#discussion_r3893378686


##########
superset-frontend/src/explore/components/controls/ConditionalFormattingControl/types.ts:
##########
@@ -51,6 +51,7 @@ export type ConditionalFormattingControlProps = ControlComponentProps<
   description: string;
   extraColorChoices?: { label: string; colors: string[] }[];
   allColumns?: ColumnOption[];
+  columnMetricFlag?: boolean;

Review Comment:
   `columnMetricFlag` is hard to interpret from the name (it reads like a boolean about columns vs metrics, but it’s used to switch the control into a metric-only UI mode). Consider renaming to something more explicit like `metricOnly`, `isMetricOnlyMode`, or `hideFormattingTargets`, or add a short doc comment explaining what behavior the flag enables/disable.



##########
superset-frontend/src/explore/components/controls/ConditionalFormattingControl/FormattingPopoverContent.tsx:
##########
@@ -262,8 +264,10 @@ export const FormattingPopoverContent = ({
     config?.column || columns[0]?.value,
   );
   const visibleAllColumns = useMemo(
-    () => !!(allColumns && Array.isArray(allColumns) && allColumns.length),
-    [allColumns],
+    () =>
+      !columnMetricFlag &&
+      !!(allColumns && Array.isArray(allColumns) && allColumns.length),
+    [allColumns, columnMetricFlag],
   );

Review Comment:
   When `columnMetricFlag` is true the UI hides the `columnFormatting`/`objectFormatting` fields, but the form can still carry previously-initialized values from `initialValues={config}` (AntD Form preserves unmounted fields by default). This can cause hidden/stale formatting-target values to be submitted even though the user cannot see/edit them in metric-only mode. Recommended fix: when `columnMetricFlag` is true, explicitly clear/omit those fields on submit (e.g., wrap `onFinish` to strip them), and/or set the hidden Form.Items to `preserve={false}` / reset those fields in an effect when toggling into metric-only mode.



##########
superset-frontend/src/explore/components/controls/ConditionalFormattingControl/types.ts:
##########
@@ -61,6 +62,7 @@ export type FormattingPopoverProps = PopoverProps & {
   children: ReactNode;
   extraColorChoices?: { label: string; colors: string[] }[];
   allColumns?: ColumnOption[];
+  columnMetricFlag?: boolean;

Review Comment:
   `columnMetricFlag` is hard to interpret from the name (it reads like a boolean about columns vs metrics, but it’s used to switch the control into a metric-only UI mode). Consider renaming to something more explicit like `metricOnly`, `isMetricOnlyMode`, or `hideFormattingTargets`, or add a short doc comment explaining what behavior the flag enables/disable.



##########
superset-frontend/plugins/plugin-chart-country-map/test/CountryMap.test.tsx:
##########
@@ -246,3 +246,129 @@ describe('CountryMap (legacy d3)', () => {
     });
   });
 });
+
+describe('CountryMap conditional formatting', () => {
+  beforeEach(() => {
+    jest.clearAllMocks();
+  });
+
+  test('applies conditional formatting color when formatter matches metric value', async () => {
+    d3Any.json.mockImplementation((_url: string, cb: D3JsonCallback) =>
+      cb(null, mockMapData),
+    );
+
+    const mockFormatters = [
+      {
+        column: 'metric',
+        getColorFromValue: (val: number) =>
+          val >= 100 ? '#FF0000' : undefined,
+      },
+    ];
+
+    render(
+      <ReactCountryMap
+        width={500}
+        height={300}
+        data={[{ country_id: 'CAN', metric: 100 }]}
+        country="canada"
+        linearColorScheme="bnbColors"
+        colorScheme=""
+        formatter={jest.fn().mockReturnValue('100')}
+        formatters={mockFormatters}
+      />,
+    );
+
+    const region = document.querySelector('path.region');
+    expect(region).not.toBeNull();
+    expect(region).toHaveStyle({ fill: '#FF0000' });
+  });
+
+  test('falls back to default color when conditional formatter threshold is not met', async () => {
+    d3Any.json.mockImplementation((_url: string, cb: D3JsonCallback) =>
+      cb(null, mockMapData),
+    );
+
+    const mockFormatters = [
+      {
+        column: 'metric',
+        getColorFromValue: (val: number) => (val > 500 ? '#FF0000' : undefined),
+      },
+    ];
+
+    render(
+      <ReactCountryMap
+        width={500}
+        height={300}
+        data={[{ country_id: 'CAN', metric: 100 }]}
+        country="canada"
+        linearColorScheme="bnbColors"
+        colorScheme=""
+        formatter={jest.fn().mockReturnValue('100')}
+        formatters={mockFormatters}
+      />,
+    );
+
+    const region = document.querySelector('path.region');
+    expect(region).not.toBeNull();
+    expect(region).not.toHaveStyle({ fill: '#FF0000' });
+    expect(region).toHaveStyle({ fill: 'rgb(21, 74, 134)' });

Review Comment:
   This assertion hard-codes an exact RGB output for the default color scale, which is likely to be brittle if the `bnbColors` palette or color scaling implementation changes. A more stable test would derive the expected color from the same scheme registry/scale used by the component, or assert the fallback behavior more generally (e.g., it is not the conditional formatting color and is a non-empty fill).



##########
superset-frontend/plugins/plugin-chart-country-map/src/CountryMap.ts:
##########
@@ -125,11 +128,19 @@ function CountryMap(element: HTMLElement, props: CountryMapProps) {
       ? colorScale(d.country_id, sliceId)
       : (linearColorScale(d.metric) ?? '');
   });
+  const regionMap = new Map(data.map(region => [region.country_id, region]));
 
   const colorFn = (feature: GeoFeature): string => {
     if (!feature?.properties) return '#d9d9d9';
-    const iso = feature.properties.ISO;
-    return colorMap[iso] || '#d9d9d9';
+    const regionData = regionMap.get(feature.properties.ISO);
+
+    if (regionData && formatters?.length > 0) {
+      for (const colorFormatter of formatters) {
+        const cfColor = colorFormatter.getColorFromValue(regionData.metric);
+        if (cfColor) return cfColor;
+      }
+    }
+    return colorMap[feature.properties.ISO] || '#d9d9d9';
   };

Review Comment:
   The formatter evaluation runs inside `colorFn`, which is called per feature. With many features and multiple conditional rules, this becomes O(features × rules) on each render. Consider precomputing a `conditionalColorByIso` map once (iterate `data` and apply the formatter chain per row) and then have `colorFn` do an O(1) lookup before falling back to `colorMap`.



##########
superset-frontend/src/explore/components/controls/ConditionalFormattingControl/FormattingPopoverContent.tsx:
##########
@@ -461,7 +465,7 @@ export const FormattingPopoverContent = ({
           </Col>
         </Row>
       ) : null}
-      {visibleUseGradient && (
+      {(columnMetricFlag || visibleUseGradient) && (

Review Comment:
   When `columnMetricFlag` is true the UI hides the `columnFormatting`/`objectFormatting` fields, but the form can still carry previously-initialized values from `initialValues={config}` (AntD Form preserves unmounted fields by default). This can cause hidden/stale formatting-target values to be submitted even though the user cannot see/edit them in metric-only mode. Recommended fix: when `columnMetricFlag` is true, explicitly clear/omit those fields on submit (e.g., wrap `onFinish` to strip them), and/or set the hidden Form.Items to `preserve={false}` / reset those fields in an effect when toggling into metric-only mode.



##########
superset-frontend/plugins/plugin-chart-country-map/src/controlPanel.ts:
##########
@@ -71,6 +73,43 @@ const config: ControlPanelConfig = {
         ],
         ['currency_format'],
         ['linear_color_scheme'],
+        [
+          {
+            name: 'conditional_formatting',
+            config: {
+              type: 'ConditionalFormattingControl',
+              renderTrigger: true,
+              label: t('Custom conditional formatting'),
+              description: t(
+                'Apply conditional color formatting to numeric columns',
+              ),
+              columnMetricFlag: true,
+              shouldMapStateToProps() {
+                return true;
+              },
+              mapStateToProps(explore, _, chart) {
+                const chartStatus = chart?.chartStatus;
+                const verboseMap = explore?.datasource?.hasOwnProperty(
+                  'verbose_map',
+                )
+                  ? (explore?.datasource as Dataset)?.verbose_map
+                  : (explore?.datasource?.columns ?? {});
+                const columnOptions = [
+                  {
+                    value: 'metric',
+                    label: 'metric',
+                    dataType: GenericDataType.Numeric,
+                  },
+                ];
+                return {
+                  removeIrrelevantConditions: chartStatus === 'success',
+                  columnOptions,
+                  verboseMap,
+                };
+              },

Review Comment:
   Two concrete issues in the `verboseMap` construction: (1) using `obj.hasOwnProperty(...)` directly is discouraged (can be shadowed); prefer `Object.prototype.hasOwnProperty.call(explore?.datasource, 'verbose_map')`. (2) falling back to `explore?.datasource?.columns` likely yields an array/shape that is not a `{[key: string]: string}` verbose map, so `verboseMap?.[column]` will often be undefined. Consider defaulting to `{}` (or building a proper mapping from `columns` if needed) so label resolution behaves deterministically.



-- 
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] feat: add conditional formating to CountryMap plugin [superset]

Posted by "rusackas (via GitHub)" <gi...@apache.org>.
rusackas commented on code in PR #42941:
URL: https://github.com/apache/superset/pull/42941#discussion_r3972986569


##########
superset-frontend/plugins/plugin-chart-country-map/src/transformProps.ts:
##########
@@ -64,6 +67,7 @@ export default function transformProps(chartProps: ChartProps) {
       ? { country_id: row[entityLabel], metric: row[metricLabel] }
       : row,
   );
+  const formatters = getColorFormatters(conditionalFormatting, data, theme);

Review Comment:
   This got covered in 5d0008e1f52 ("add a test and a small fix") - there's now a test asserting `transformed.formatters` from `getColorFormatters`, plus one for the empty case. Resolving.



-- 
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] feat: add conditional formating to CountryMap plugin [superset]

Posted by "bito-code-review[bot] (via GitHub)" <gi...@apache.org>.
bito-code-review[bot] commented on PR #42941:
URL: https://github.com/apache/superset/pull/42941#issuecomment-5502570440

   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 an incremental AI Review.
   - `/review full` - 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] feat: add conditional formating to CountryMap plugin [superset]

Posted by "SBIN2010 (via GitHub)" <gi...@apache.org>.
SBIN2010 commented on PR #42941:
URL: https://github.com/apache/superset/pull/42941#issuecomment-5286768492

   /review


-- 
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] feat: add conditional formating to CountryMap plugin [superset]

Posted by "codecov[bot] (via GitHub)" <gi...@apache.org>.
codecov[bot] commented on PR #42941:
URL: https://github.com/apache/superset/pull/42941#issuecomment-5234031198

   ## [Codecov](https://app.codecov.io/gh/apache/superset/pull/42941?dropdown=coverage&src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) Report
   :x: Patch coverage is `60.71429%` with `11 lines` in your changes missing coverage. Please review.
   :white_check_mark: Project coverage is 66.42%. Comparing base ([`4a587b8`](https://app.codecov.io/gh/apache/superset/commit/4a587b8539806650785e3185a5682dd5200fce8e?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)) to head ([`7cadfc6`](https://app.codecov.io/gh/apache/superset/commit/7cadfc639d26c8bd9ee4b83d22c43a4157cff510?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)).
   :warning: Report is 8 commits behind head on master.
   
   | [Files with missing lines](https://app.codecov.io/gh/apache/superset/pull/42941?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | Patch % | Lines |
   |---|---|---|
   | [...ugins/plugin-chart-country-map/src/controlPanel.ts](https://app.codecov.io/gh/apache/superset/pull/42941?src=pr&el=tree&filepath=superset-frontend%2Fplugins%2Fplugin-chart-country-map%2Fsrc%2FcontrolPanel.ts&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-c3VwZXJzZXQtZnJvbnRlbmQvcGx1Z2lucy9wbHVnaW4tY2hhcnQtY291bnRyeS1tYXAvc3JjL2NvbnRyb2xQYW5lbC50cw==) | 0.00% | [6 Missing :warning: ](https://app.codecov.io/gh/apache/superset/pull/42941?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) |
   | [...plugins/plugin-chart-country-map/src/CountryMap.ts](https://app.codecov.io/gh/apache/superset/pull/42941?src=pr&el=tree&filepath=superset-frontend%2Fplugins%2Fplugin-chart-country-map%2Fsrc%2FCountryMap.ts&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-c3VwZXJzZXQtZnJvbnRlbmQvcGx1Z2lucy9wbHVnaW4tY2hhcnQtY291bnRyeS1tYXAvc3JjL0NvdW50cnlNYXAudHM=) | 42.85% | [4 Missing :warning: ](https://app.codecov.io/gh/apache/superset/pull/42941?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) |
   | [...onalFormattingControl/FormattingPopoverContent.tsx](https://app.codecov.io/gh/apache/superset/pull/42941?src=pr&el=tree&filepath=superset-frontend%2Fsrc%2Fexplore%2Fcomponents%2Fcontrols%2FConditionalFormattingControl%2FFormattingPopoverContent.tsx&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2V4cGxvcmUvY29tcG9uZW50cy9jb250cm9scy9Db25kaXRpb25hbEZvcm1hdHRpbmdDb250cm9sL0Zvcm1hdHRpbmdQb3BvdmVyQ29udGVudC50c3g=) | 92.30% | [1 Missing :warning: ](https://app.codecov.io/gh/apache/superset/pull/42941?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) |
   
   <details><summary>Additional details and impacted files</summary>
   
   
   
   ```diff
   @@            Coverage Diff             @@
   ##           master   #42941      +/-   ##
   ==========================================
   - Coverage   66.42%   66.42%   -0.01%     
   ==========================================
     Files        2858     2858              
     Lines      161342   161367      +25     
     Branches    37162    37167       +5     
   ==========================================
   + Hits       107170   107183      +13     
   - Misses      52146    52158      +12     
     Partials     2026     2026              
   ```
   
   | [Flag](https://app.codecov.io/gh/apache/superset/pull/42941/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | Coverage Δ | |
   |---|---|---|
   | [javascript](https://app.codecov.io/gh/apache/superset/pull/42941/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `73.26% <60.71%> (-0.01%)` | :arrow_down: |
   
   Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#carryforward-flags-in-the-pull-request-comment) to find out more.
   </details>
   
   [:umbrella: View full report in Codecov by Harness](https://app.codecov.io/gh/apache/superset/pull/42941?dropdown=coverage&src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).   
   :loudspeaker: Have feedback on the report? [Share it here](https://about.codecov.io/codecov-pr-comment-feedback/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).
   <details><summary> :rocket: New features to boost your workflow: </summary>
   
   - :snowflake: [Test Analytics](https://docs.codecov.com/docs/test-analytics): Detect flaky tests, report on failures, and find test suite problems.
   - :package: [JS Bundle Analysis](https://docs.codecov.com/docs/javascript-bundle-analysis): Save yourself from yourself by tracking and limiting bundle sizes in JS merges.
   </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] feat: add conditional formating to CountryMap plugin [superset]

Posted by "SBIN2010 (via GitHub)" <gi...@apache.org>.
SBIN2010 commented on code in PR #42941:
URL: https://github.com/apache/superset/pull/42941#discussion_r3745422694


##########
superset-frontend/plugins/plugin-chart-country-map/src/controlPanel.ts:
##########
@@ -71,6 +72,36 @@ const config: ControlPanelConfig = {
         ],
         ['currency_format'],
         ['linear_color_scheme'],
+        [
+          {
+            name: 'conditional_formatting',
+            config: {
+              type: 'ConditionalFormattingControl',
+              renderTrigger: true,
+              label: t('Custom conditional formatting'),
+              description: t(
+                'Apply conditional color formatting to numeric columns',
+              ),
+              shouldMapStateToProps() {
+                return true;
+              },
+              mapStateToProps(_, chart) {
+                const chartStatus = chart?.chartStatus;
+                const columnOptions = [
+                  {
+                    value: 'metric',
+                    label: 'metric',
+                    dataType: GenericDataType.Numeric,
+                  },
+                ];
+                return {
+                  removeIrrelevantConditions: chartStatus === 'success',
+                  columnOptions,
+                };
+              },
+            },
+          },
+        ],

Review Comment:
   The absence of `verboseMap` will not cause a failure, because it is optional; if it is missing, the name is taken from `column`.
   `const columnName = (column && verboseMap?.[column]) ?? column;`



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