bito-code-review[bot] commented on PR #44152:
URL: https://github.com/apache/superset/pull/44152#issuecomment-5627875255
<!-- Bito Reply -->
The flagged issue is valid. When integer `1` and string `'1'` are treated as
distinct categories in the Treemap preview, they are assigned separate geometry
groups but share the same display name and color, making them visually
indistinguishable. To resolve this, ensure that all grouping keys are
normalized to a consistent type (e.g., string) before they are used to generate
the Vega-Lite specification, particularly when constructing the `domain` for
the color scale and the `path` for tooltips.
**superset/mcp_service/chart/treemap_preview.py**
```
"scale": {
"range": _PALETTES[scheme],
# Normalize keys to string to prevent type-based
collisions
"domain": list(
dict.fromkeys([str(label), *(str(node["name"])
for node in nodes)])
),
},
```
--
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]