sadpandajoe commented on code in PR #36101:
URL: https://github.com/apache/superset/pull/36101#discussion_r2525154809
##########
superset-frontend/packages/superset-ui-chart-controls/src/utils/getColorFormatters.ts:
##########
@@ -38,20 +38,20 @@ export const getOpacity = (
minOpacity = MIN_OPACITY_BOUNDED,
maxOpacity = MAX_OPACITY,
) => {
- if (
- extremeValue === cutoffPoint ||
- typeof cutoffPoint !== 'number' ||
- typeof extremeValue !== 'number' ||
- typeof value !== 'number'
- ) {
+ if (extremeValue === cutoffPoint || typeof value !== 'number') {
return maxOpacity;
}
+ const numCutoffPoint =
+ typeof cutoffPoint === 'string' ? parseFloat(cutoffPoint) : cutoffPoint;
+ const numExtremeValue =
+ typeof extremeValue === 'string' ? parseFloat(extremeValue) : extremeValue;
Review Comment:
Looks like Copilot had a similar comment and was marked resolved. Can we add
tests for these cases to ensure maxOpacity is still returned correctly if tests
don't already exist?
--
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]