codeant-ai-for-open-source[bot] commented on PR #36541: URL: https://github.com/apache/superset/pull/36541#issuecomment-3643141056
## Nitpicks 🔍 <table> <tr><td>🔒 <strong>No security issues identified</strong></td></tr> <tr><td>⚡ <strong>Recommended areas for review</strong><br><br> - [ ] <a href='https://github.com/apache/superset/pull/36541/files#diff-1554dae79940b5b23a67ba94b0a38b37d36e984fb0e9ff077d2fc6c45e9f0619R106-R124'><strong>Incorrect use of Object.values on Map</strong></a><br>The code calls Object.values(labelsColorMapInstance.getColorMap()), but getColorMap() returns a Map/iterable (previous code used Object.fromEntries on it). Using Object.values on a Map does not return the map's values and will likely produce an empty array, causing the "availableColors" lookup to fail and the code to repeatedly fall back to the original color (reintroducing duplicates). Verify the actual type returned by getColorMap() and use the appropriate method (e.g., Array.from(map.values())).<br> - [ ] <a href='https://github.com/apache/superset/pull/36541/files#diff-1554dae79940b5b23a67ba94b0a38b37d36e984fb0e9ff077d2fc6c45e9f0619R106-R124'><strong>Non-deterministic / fallback duplicate risk</strong></a><br>When no unused color is found, the code falls back to the original color (|| color), which can still produce duplicates. Also, availableColors is recomputed on each collision check; computing and reusing a deterministic palette and using a deterministic selection strategy (queue/round-robin) would avoid non-deterministic assignment and further duplicates.<br> </td></tr> </table> -- 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]
