Skip to content

fix(chart): added Big Number chart support for MAX metric with VARCHAR column#41182

Open
omkarhall wants to merge 4 commits into
apache:masterfrom
omkarhall:feature/big-number-support-non-numeric
Open

fix(chart): added Big Number chart support for MAX metric with VARCHAR column#41182
omkarhall wants to merge 4 commits into
apache:masterfrom
omkarhall:feature/big-number-support-non-numeric

Conversation

@omkarhall

@omkarhall omkarhall commented Jun 18, 2026

Copy link
Copy Markdown

SUMMARY

The issue I am addressing is that Big Number charts previously displayed "No data" when the metric result was a non-empty, non-date string value. My fix for this is the below:
In utils.ts parseMetricValue returns null for non-date strings. Now, in transformProps.ts after parseMetricValue returns null, if the original raw value was a non-empty string, it falls back to that string. BigNumberViz.tsx already handles string bigNumber by displaying it directly so "No data" will no longer appear.

BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF

Before
Screenshot 2026-06-17 at 9 14 56 PM
After
Screenshot 2026-06-17 at 8 26 58 PM

TESTING INSTRUCTIONS

  1. Start Superset locally.
  2. Create or use a dataset with a non-null VARCHAR column.
  3. Create a Big Number chart using that dataset.
  4. Set the metric to MAX(varchar_column).
  5. Click Create Chart.

ADDITIONAL INFORMATION

@dosubot dosubot Bot added the viz:charts:bignumber Related to BigNumber charts label Jun 18, 2026
@bito-code-review

bito-code-review Bot commented Jun 18, 2026

Copy link
Copy Markdown
Contributor

Code Review Agent Run #9f10b0

Actionable Suggestions - 0
Additional Suggestions - 1
  • superset-frontend/plugins/plugin-chart-echarts/src/BigNumber/utils.ts - 1
    • Behavior change for invalid dates · Line 40-40
      The change from `return null` to `return metricValue` alters the behavior for invalid date strings. Previously, strings like `'abc'` would return `null` (displayed as 'No data'); now they pass through unchanged and may be displayed as-is. Additionally, `BigNumberPeriodOverPeriod/transformProps.ts` has a duplicate `parseMetricValue` that returns `0` for the same case — verify this is the intended divergence.
Review Details
  • Files reviewed - 1 · Commit Range: de470af..de470af
    • superset-frontend/plugins/plugin-chart-echarts/src/BigNumber/utils.ts
  • Files skipped - 0
  • Tools
    • Whispers (Secret Scanner) - ✔︎ Successful
    • Detect-secrets (Secret Scanner) - ✔︎ Successful
    • Eslint (Linter) - ✔︎ Successful

Bito Usage Guide

Commands

Type the following command in the pull request comment and save the comment.

  • /review - Manually triggers a full AI review.

  • /pause - Pauses automatic reviews on this pull request.

  • /resume - Resumes automatic reviews.

  • /resolve - Marks all Bito-posted review comments as resolved.

  • /abort - Cancels all in-progress reviews.

Refer to the documentation for additional commands.

Configuration

This repository uses Superset You can customize the agent settings here or contact your Bito workspace admin at evan@preset.io.

Documentation & Help

AI Code Review powered by Bito Logo

Comment thread superset-frontend/plugins/plugin-chart-echarts/src/BigNumber/utils.ts Outdated
@bito-code-review

Copy link
Copy Markdown
Contributor

The flagged issue is correct. Returning raw strings from parseMetricValue breaks downstream numeric calculations, such as trendline aggregation and percentage change, which expect numeric values and will result in NaN when encountering strings. To resolve this, parseMetricValue should continue returning null for non-date strings in shared paths, and string preservation should be handled explicitly only where needed (e.g., in the Big Number Total path).

Here is the corrected implementation for superset-frontend/plugins/plugin-chart-echarts/src/BigNumber/utils.ts:

    if (dateObject.isValid()) {
      return dateObject.valueOf();
    }
    return null;
  }
  return metricValue;
};

There are no other comments in the provided review data to address. Would you like me to check for any other potential issues in this file?

superset-frontend/plugins/plugin-chart-echarts/src/BigNumber/utils.ts

if (dateObject.isValid()) {
      return dateObject.valueOf();
    }
    return null;
  }
  return metricValue;
};

@bito-code-review

bito-code-review Bot commented Jun 18, 2026

Copy link
Copy Markdown
Contributor

Code Review Agent Run #f0e81d

Actionable Suggestions - 0
Review Details
  • Files reviewed - 2 · Commit Range: de470af..971a7c3
    • superset-frontend/plugins/plugin-chart-echarts/src/BigNumber/BigNumberTotal/transformProps.ts
    • superset-frontend/plugins/plugin-chart-echarts/src/BigNumber/utils.ts
  • Files skipped - 0
  • Tools
    • Whispers (Secret Scanner) - ✔︎ Successful
    • Detect-secrets (Secret Scanner) - ✔︎ Successful
    • Eslint (Linter) - ✔︎ Successful

Bito Usage Guide

Commands

Type the following command in the pull request comment and save the comment.

  • /review - Manually triggers a full AI review.

  • /pause - Pauses automatic reviews on this pull request.

  • /resume - Resumes automatic reviews.

  • /resolve - Marks all Bito-posted review comments as resolved.

  • /abort - Cancels all in-progress reviews.

Refer to the documentation for additional commands.

Configuration

This repository uses Superset You can customize the agent settings here or contact your Bito workspace admin at evan@preset.io.

Documentation & Help

AI Code Review powered by Bito Logo

@codecov

codecov Bot commented Jun 18, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 80.00000% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 64.31%. Comparing base (7e98410) to head (971a7c3).
⚠️ Report is 10 commits behind head on master.

Files with missing lines Patch % Lines
...rts/src/BigNumber/BigNumberTotal/transformProps.ts 80.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master   #41182      +/-   ##
==========================================
- Coverage   64.31%   64.31%   -0.01%     
==========================================
  Files        2651     2651              
  Lines      144784   144788       +4     
  Branches    33409    33413       +4     
==========================================
- Hits        93125    93122       -3     
- Misses      49991    49998       +7     
  Partials     1668     1668              
Flag Coverage Δ
javascript 68.45% <80.00%> (-0.01%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@netlify

netlify Bot commented Jun 18, 2026

Copy link
Copy Markdown

Deploy Preview for superset-docs-preview ready!

Name Link
🔨 Latest commit 1cb8746
🔍 Latest deploy log https://app.netlify.com/projects/superset-docs-preview/deploys/6a3416dcc2673400080e5500
😎 Deploy Preview https://deploy-preview-41182--superset-docs-preview.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

@bito-code-review

bito-code-review Bot commented Jun 18, 2026

Copy link
Copy Markdown
Contributor

Code Review Agent Run #db677e

Actionable Suggestions - 0
Review Details
  • Files reviewed - 2 · Commit Range: 971a7c3..0df282d
    • superset-frontend/plugins/plugin-chart-echarts/src/BigNumber/BigNumberTotal/transformProps.test.ts
    • superset-frontend/plugins/plugin-chart-echarts/src/BigNumber/BigNumberTotal/transformProps.ts
  • Files skipped - 0
  • Tools
    • Eslint (Linter) - ✔︎ Successful
    • Whispers (Secret Scanner) - ✔︎ Successful
    • Detect-secrets (Secret Scanner) - ✔︎ Successful

Bito Usage Guide

Commands

Type the following command in the pull request comment and save the comment.

  • /review - Manually triggers a full AI review.

  • /pause - Pauses automatic reviews on this pull request.

  • /resume - Resumes automatic reviews.

  • /resolve - Marks all Bito-posted review comments as resolved.

  • /abort - Cancels all in-progress reviews.

Refer to the documentation for additional commands.

Configuration

This repository uses Superset You can customize the agent settings here or contact your Bito workspace admin at evan@preset.io.

Documentation & Help

AI Code Review powered by Bito Logo

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

plugins size/M viz:charts:bignumber Related to BigNumber charts

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant