Skip to content

Commit b29b00a

Browse files
committed
add comments for checks
1 parent 8ee2c8e commit b29b00a

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

superset-frontend/plugins/plugin-chart-table/src/controlPanel.tsx

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -589,6 +589,8 @@ const config: ControlPanelConfig = {
589589
last(colname.split('__')) !== timeComparisonValue,
590590
)
591591
.forEach((colname, index) => {
592+
// Skip unprefixed percent metric columns if a prefixed version exists
593+
// But don't skip if it's also a regular metric
592594
if (
593595
colname &&
594596
!colname.startsWith('%') &&
@@ -602,8 +604,10 @@ const config: ControlPanelConfig = {
602604
getMetricLabel(metric) === colname,
603605
)
604606
) {
605-
return;
607+
return; // skip this column
606608
}
609+
610+
// Check if column is a regular metric or percentage metric
607611
const isMetric = explore.form_data.metrics?.some(
608612
metric => getMetricLabel(metric) === colname,
609613
);
@@ -613,6 +617,7 @@ const config: ControlPanelConfig = {
613617
`%${getMetricLabel(metric)}` === colname,
614618
);
615619

620+
// Generate comparison columns for metrics (time comparison feature)
616621
if (isMetric || isPercentMetric) {
617622
const comparisonColumns =
618623
generateComparisonColumns(colname);

0 commit comments

Comments
 (0)