fix(table): Double percenting ad-hoc percentage metrics (#25857)

(cherry picked from commit 784a478268)
This commit is contained in:
John Bodley
2023-11-08 12:22:00 -08:00
committed by Michael S. Molina
parent 078b78f30b
commit eea6a8ed4f

View File

@@ -118,9 +118,10 @@ const processColumns = memoizeOne(function processColumns(
// because users can also add things like `MAX(str_col)` as a metric.
const isMetric = metricsSet.has(key) && isNumeric(key, records);
const isPercentMetric = percentMetricsSet.has(key);
const label = isPercentMetric
? `%${verboseMap?.[key.replace('%', '')] || key}`
: verboseMap?.[key] || key;
const label =
isPercentMetric && verboseMap?.hasOwnProperty(key.replace('%', ''))
? `%${verboseMap[key.replace('%', '')]}`
: verboseMap?.[key] || key;
const isTime = dataType === GenericDataType.TEMPORAL;
const isNumber = dataType === GenericDataType.NUMERIC;
const savedFormat = columnFormats?.[key];