Skip to content

fix(Table chart): fix percentage metric column #34175

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 26 commits into
base: master
Choose a base branch
from

Conversation

LevisNgigi
Copy link
Contributor

@LevisNgigi LevisNgigi commented Jul 15, 2025

SUMMARY

Related to PR. Fixes a bug in the Table chart where percentage metrics (e.g., %count) did not appear or behave correctly in the Customize Columns section.

BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF

BEFORE

2025-07-17.20-41-55.mp4

AFTER

after.mp4

TESTING INSTRUCTIONS

  1. Go to Chart > Table and create a chart using a COUNT(*) or similar metric.
  2. Add this metric to the Percentage Metrics section.
  3. ensure time comparison is enabled
  4. Run the chart,confirm that %count is visible in the result table.
  5. Go to the Customize Columns section.
    You should now:
    a)See Main %count listed and the child columns.
    b)Be able to rename it (e.g., "Conversion Rate")
    c)Hide child columns, and verify they disappear from the table
    d)Also verify that comparison columns for %count are generated properly when time comparison is enabled and regular metrics like COUNT(*) are preserved and configurable

ADDITIONAL INFORMATION

  • Has associated issue:
  • Required feature flags:
  • Changes UI
  • Includes DB Migration (follow approval process in SIP-59)
    • Migration is atomic, supports rollback & is backwards-compatible
    • Confirm DB migration upgrade and downgrade tested
    • Runtime estimates and downtime expectations provided
  • Introduces new feature or API
  • Removes existing feature or API

@dosubot dosubot bot added the viz:charts:table Related to the Table chart label Jul 15, 2025
Copy link

@korbit-ai korbit-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review by Korbit AI

Korbit automatically attempts to detect when you fix issues in new commits.
Category Issue Status
Functionality Incorrect percentage metric filtering logic ▹ view ✅ Fix detected
Files scanned
File Path Reviewed
superset-frontend/src/explore/components/controls/ColumnConfigControl/ColumnConfigItem.tsx
superset-frontend/plugins/plugin-chart-table/src/controlPanel.tsx

Explore our documentation to understand the languages and file types we support and the files we ignore.

Check out our docs on how you can make Korbit work best for you and your team.

Loving Korbit!? Share us on LinkedIn Reddit and X

Comment on lines 592 to 606
if (
explore.form_data.metrics?.some(
metric => getMetricLabel(metric) === colname,
) ||
colname &&
!colname.startsWith('%') &&
colnames.includes(`%${colname}`) &&
explore.form_data.percent_metrics?.some(
(metric: QueryFormMetric) =>
getMetricLabel(metric) === colname,
) &&
!explore.form_data.metrics?.some(
(metric: QueryFormMetric) =>
getMetricLabel(metric) === colname,
)
) {
return;
}

This comment was marked as resolved.

@pull-request-size pull-request-size bot added size/M and removed size/S labels Jul 16, 2025
@pull-request-size pull-request-size bot added size/L and removed size/M labels Jul 17, 2025
@LevisNgigi LevisNgigi closed this Jul 17, 2025
@LevisNgigi LevisNgigi reopened this Jul 17, 2025
@LevisNgigi LevisNgigi force-pushed the fix-percentage-metric-bug branch from 110463b to 19cde09 Compare July 17, 2025 19:13
@LevisNgigi LevisNgigi force-pushed the fix-percentage-metric-bug branch from 1ab405f to 19cde09 Compare July 18, 2025 11:27
@LevisNgigi LevisNgigi requested a review from amaannawab923 July 18, 2025 13:03
Copy link
Contributor

@amaannawab923 amaannawab923 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM !!

@LevisNgigi LevisNgigi requested a review from betodealmeida July 31, 2025 12:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants