Skip to content

Commit

Permalink
fix(table): percentage metric should use verbose map (#24158)
Browse files Browse the repository at this point in the history
  • Loading branch information
Always-prog authored May 21, 2023
1 parent 09e399a commit febc07a
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -111,13 +111,15 @@ const processColumns = memoizeOne(function processColumns(
!(rawPercentMetricsSet.has(key) && !metricsSet.has(key)),
)
.map((key: string, i) => {
const label = verboseMap?.[key] || key;
const dataType = coltypes[i];
const config = columnConfig[key] || {};
// for the purpose of presentation, only numeric values are treated as metrics
// 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 isTime = dataType === GenericDataType.TEMPORAL;
const isNumber = dataType === GenericDataType.NUMERIC;
const savedFormat = columnFormats?.[key];
Expand Down

0 comments on commit febc07a

Please sign in to comment.