Skip to content

Commit

Permalink
fix(table): Double percenting ad-hoc percentage metrics (apache#25857)
Browse files Browse the repository at this point in the history
  • Loading branch information
john-bodley committed Nov 8, 2023
1 parent 458be8c commit 784a478
Showing 1 changed file with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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];
Expand Down

0 comments on commit 784a478

Please sign in to comment.