codeant-ai-for-open-source[bot] commented on code in PR #45585:
URL: https://github.com/apache/superset/pull/45585#discussion_r4343187139


##########
superset-frontend/plugins/preset-chart-deckgl/src/utils.ts:
##########
@@ -25,12 +25,20 @@ import {
   QueryFormData,
   SequentialScheme,
 } from '@superset-ui/core';
+import { Constants } from '@superset-ui/core/components';
 import { Color } from '@deck.gl/core';
 import { hexToRGB } from './utils/colors';
 import { ColorBreakpointType } from './types';
 
 export const TRANSPARENT_COLOR_ARRAY = [0, 0, 0, 0] as Color;
 export const HIGHLIGHT_COLOR_ARRAY = [255, 0, 0, 255] as Color;
+// Stands in for a null dimension value so those rows still get a category, a
+// color and a legend entry. Kept distinct from NULL_DISPLAY so the key stays
+// stable across locales.
+export const NULL_CATEGORY_KEY = '<NULL>';

Review Comment:
   ✅ **Customized review instruction saved!**
   
   **Instruction:**
   > Do not flag the `<NULL>` sentinel's potential collision with a literal 
category value; it must remain a string for category-to-color mapping, and the 
exact collision is considered acceptably rare.
   
   **Applied to:**
     - `superset-frontend/plugins/preset-chart-deckgl/src/utils.ts`
   
   ---
   💡 *To manage or update this instruction, visit: [CodeAnt AI 
Settings](https://app.codeant.ai/org/settings/learnings)*



##########
superset-frontend/plugins/preset-chart-deckgl/src/layers/Scatter/transformProps.ts:
##########
@@ -155,9 +156,10 @@ function processScatterData(
       }
     }
 
-    const categoryValue = getSourceValue(categoryColumn);
-    if (categoryValue != null) {
-      scatterPoint.cat_color = String(categoryValue);
+    if (categoryColumn) {
+      const categoryValue = getSourceValue(categoryColumn);
+      scatterPoint.cat_color =
+        categoryValue != null ? String(categoryValue) : NULL_CATEGORY_KEY;

Review Comment:
   ✅ **Customized review instruction saved!**
   
   **Instruction:**
   > Do not flag the intentional use of `<NULL>` as the null-category sentinel, 
even though it collides with a literal `<NULL>` category.
   
   **Applied to:**
     - 
`superset-frontend/plugins/preset-chart-deckgl/src/layers/Scatter/transformProps.ts`
   
   ---
   💡 *To manage or update this instruction, visit: [CodeAnt AI 
Settings](https://app.codeant.ai/org/settings/learnings)*



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to