Skip to content

fix(charts): Table chart shows an error on row limit#37218

Merged
sadpandajoe merged 6 commits intoapache:masterfrom
FelipeGLopez:fix/table-shows-error-on-row-limit
Jan 30, 2026
Merged

fix(charts): Table chart shows an error on row limit#37218
sadpandajoe merged 6 commits intoapache:masterfrom
FelipeGLopez:fix/table-shows-error-on-row-limit

Conversation

@FelipeGLopez
Copy link
Contributor

@FelipeGLopez FelipeGLopez commented Jan 17, 2026

SUMMARY

The Table chart's "Row limit" field had two problems:

  1. Missing default value: When the field was empty, it didn't initialize with a proper default value (10000), causing errors
  2. Unclear error messages: Validation errors didn't specify which field had the problem (just said "is expected to be an integer" instead of "Row limit is expected to be an integer")

Solution:

  1. Fixed default value: Updated the Row limit control to properly use a default value of 10000 when no value is present.
  2. Improved error messages: Created a withLabel utility that adds the field name to validation errors, making them clearer for users across multiple chart types (Table, Histogram, AG Grid).

BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF

Before:

Before.mov

After:

After.mov

TESTING INSTRUCTIONS

  1. Go to the charts list (with examples loaded).
  2. Open the chart: Items by Product Line.

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

@netlify
Copy link

netlify bot commented Jan 17, 2026

Deploy Preview for superset-docs-preview ready!

Name Link
🔨 Latest commit a419754
🔍 Latest deploy log https://app.netlify.com/projects/superset-docs-preview/deploys/69775b628a7f890008ce934d
😎 Deploy Preview https://deploy-preview-37218--superset-docs-preview.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

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

@FelipeGLopez FelipeGLopez changed the title Address label issue fix(charts): Table chart shows an error on row limit Jan 20, 2026
@FelipeGLopez FelipeGLopez marked this pull request as ready for review January 20, 2026 13:39
@dosubot dosubot bot added the viz:charts:table Related to the Table chart label Jan 20, 2026
@bito-code-review
Copy link
Contributor

bito-code-review bot commented Jan 20, 2026

Code Review Agent Run #5f2cf0

Actionable Suggestions - 0
Additional Suggestions - 1
  • superset-frontend/packages/superset-ui-core/src/validator/validateNumber.ts - 1
    • Type safety violation · Line 22-22
      The function parameter uses 'any', which violates the project's TypeScript standards requiring proper typing instead of 'any'. Change to 'unknown' for better type safety, matching the pattern in validateInteger.ts.
      Code suggestion
       @@ -22,1 +22,1 @@
      - export default function validateNumber(v: any) {
      + export default function validateNumber(v: unknown) {
Review Details
  • Files reviewed - 7 · Commit Range: 3dc4594..1c5418e
    • superset-frontend/packages/superset-ui-core/src/utils/index.ts
    • superset-frontend/packages/superset-ui-core/src/utils/withLabel.ts
    • superset-frontend/packages/superset-ui-core/src/validator/validateNumber.ts
    • superset-frontend/packages/superset-ui-core/test/validator/validateMaxValue.test.ts
    • superset-frontend/plugins/plugin-chart-ag-grid-table/src/controlPanel.tsx
    • superset-frontend/plugins/plugin-chart-echarts/src/Histogram/controlPanel.tsx
    • superset-frontend/plugins/plugin-chart-table/src/controlPanel.tsx
  • 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

validator: (v: unknown, state?: any) => string | false,
label: string,
) {
return (v: unknown, state?: any) => {
Copy link
Member

Choose a reason for hiding this comment

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

Types are a bit shallow. Can we improve?

@bito-code-review
Copy link
Contributor

Yes, the types can be improved by making the function generic over the value type to preserve type safety. This avoids using 'unknown' loosely and ensures the validator and returned function share the same input type.

superset-frontend/packages/superset-ui-core/src/utils/withLabel.ts

export default function withLabel<T>(
  validator: (v: T, state?: any) => string | false,
  label: string,
): (v: T, state?: any) => string | false {
  return (v: T, state?: any) => {
    const error = validator(v, state);
    return error ? `${label} ${error}` : false;
  };
}

@pull-request-size pull-request-size bot added size/L and removed size/M labels Jan 26, 2026
Copy link
Contributor

@bito-code-review bito-code-review bot left a comment

Choose a reason for hiding this comment

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

Code Review Agent Run #0ea597

Actionable Suggestions - 1
  • superset-frontend/packages/superset-ui-core/src/validator/validateTimeComparisonRangeValues.ts - 1
Review Details
  • Files reviewed - 17 · Commit Range: 1c5418e..84c1224
    • superset-frontend/packages/superset-ui-core/src/utils/index.ts
    • superset-frontend/packages/superset-ui-core/src/utils/withLabel.ts
    • superset-frontend/packages/superset-ui-core/src/validator/index.ts
    • superset-frontend/packages/superset-ui-core/src/validator/legacyValidateInteger.ts
    • superset-frontend/packages/superset-ui-core/src/validator/legacyValidateNumber.ts
    • superset-frontend/packages/superset-ui-core/src/validator/types.ts
    • superset-frontend/packages/superset-ui-core/src/validator/validateInteger.ts
    • superset-frontend/packages/superset-ui-core/src/validator/validateMapboxStylesUrl.ts
    • superset-frontend/packages/superset-ui-core/src/validator/validateMaxValue.ts
    • superset-frontend/packages/superset-ui-core/src/validator/validateNonEmpty.ts
    • superset-frontend/packages/superset-ui-core/src/validator/validateNumber.ts
    • superset-frontend/packages/superset-ui-core/src/validator/validateServerPagination.ts
    • superset-frontend/packages/superset-ui-core/src/validator/validateTimeComparisonRangeValues.ts
    • superset-frontend/packages/superset-ui-core/test/validator/validateMaxValue.test.ts
    • superset-frontend/plugins/plugin-chart-ag-grid-table/src/controlPanel.tsx
    • superset-frontend/plugins/plugin-chart-echarts/src/Histogram/controlPanel.tsx
    • superset-frontend/plugins/plugin-chart-table/src/controlPanel.tsx
  • 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

clearable: false,
mapStateToProps: state => ({
mapStateToProps: (state, controlState) => ({
value: controlState?.value ?? 10000,
Copy link
Member

Choose a reason for hiding this comment

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

Config has a default field you can use. Wouldn't that be enough?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The default value is 10000, but the issue persists even after changing it.

Copy link
Member

Choose a reason for hiding this comment

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

Then do you think the issue might be in the control or the component?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Let me revise the control again.

Copy link
Contributor Author

@FelipeGLopez FelipeGLopez Jan 29, 2026

Choose a reason for hiding this comment

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

I found this issue here with undefined & null. Also, there was another default prop outside the config in a json called override that in this particular case didn't have any effect. I deleted it.

if (state.default != null && value == null) {
value = state.default;
}
// If a choice control went from multi=false to true, wrap value in array
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggestion: Reinventing and duplicating array-wrapping logic: the code manually checks and wraps values for multi controls instead of using the existing ensureIsArray helper imported at the top; this can miss edge cases and is less clear. Replace the manual wrapping with ensureIsArray to consistently normalize to array when required. [code duplication]

Severity Level: Major ⚠️
- ❌ Control normalization bugs for multi-choice controls.
- ⚠️ Inconsistent value shapes across control initialization.
- ⚠️ Tests relying on array normalization may fail intermittently.

@bito-code-review
Copy link
Contributor

bito-code-review bot commented Jan 29, 2026

Code Review Agent Run #748e5a

Actionable Suggestions - 0
Review Details
  • Files reviewed - 18 · Commit Range: 84c1224..c95eec0
    • superset-frontend/packages/superset-ui-core/src/utils/index.ts
    • superset-frontend/packages/superset-ui-core/src/utils/withLabel.ts
    • superset-frontend/packages/superset-ui-core/src/validator/index.ts
    • superset-frontend/packages/superset-ui-core/src/validator/legacyValidateInteger.ts
    • superset-frontend/packages/superset-ui-core/src/validator/legacyValidateNumber.ts
    • superset-frontend/packages/superset-ui-core/src/validator/types.ts
    • superset-frontend/packages/superset-ui-core/src/validator/validateInteger.ts
    • superset-frontend/packages/superset-ui-core/src/validator/validateMapboxStylesUrl.ts
    • superset-frontend/packages/superset-ui-core/src/validator/validateMaxValue.ts
    • superset-frontend/packages/superset-ui-core/src/validator/validateNonEmpty.ts
    • superset-frontend/packages/superset-ui-core/src/validator/validateNumber.ts
    • superset-frontend/packages/superset-ui-core/src/validator/validateServerPagination.ts
    • superset-frontend/packages/superset-ui-core/src/validator/validateTimeComparisonRangeValues.ts
    • superset-frontend/packages/superset-ui-core/test/validator/validateMaxValue.test.ts
    • superset-frontend/plugins/plugin-chart-ag-grid-table/src/controlPanel.tsx
    • superset-frontend/plugins/plugin-chart-echarts/src/Histogram/controlPanel.tsx
    • superset-frontend/plugins/plugin-chart-table/src/controlPanel.tsx
    • superset-frontend/src/explore/controlUtils/getControlState.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

// If no current value, set it as default
if (state.default && value === undefined) {
// Use loose equality to catch both null and undefined
if (state.default != null && value == null) {
Copy link
Member

Choose a reason for hiding this comment

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

This looks much cleaner, great work!

@msyavuz msyavuz added the hold:testing! On hold for testing label Jan 30, 2026
@dirivasm
Copy link

Test Summary

  • Row limit when it has a default value ✅
  • Row limit when there is no default value ✅
  • Row limit error message ✅
  • Row limit functionality ✅

All above scenarios working as expected - QA Approved

@sadpandajoe sadpandajoe removed the hold:testing! On hold for testing label Jan 30, 2026
@sadpandajoe
Copy link
Member

Testing done. QA approved.

@sadpandajoe sadpandajoe merged commit 9764a84 into apache:master Jan 30, 2026
96 of 98 checks passed
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.

5 participants