Skip to content

feat: enable translation or customization of the constants "<NULL>", "TRUE", "FALSE" and "<empty string>"#40919

Open
nicob3y wants to merge 2 commits into
apache:masterfrom
nicob3y:feat/null-true-false-translatable
Open

feat: enable translation or customization of the constants "<NULL>", "TRUE", "FALSE" and "<empty string>"#40919
nicob3y wants to merge 2 commits into
apache:masterfrom
nicob3y:feat/null-true-false-translatable

Conversation

@nicob3y

@nicob3y nicob3y commented Jun 9, 2026

Copy link
Copy Markdown
Contributor

SUMMARY

This PR aims to easily allow translation or customization of the constants <NULL>, TRUE, FALSE, and <empty string>.

BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF

Here is an example of customizing <NULL> into French, before and after:

image image

TESTING INSTRUCTIONS

To test this change, you must first translate the strings in question and observe the screens where they may be displayed.

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 i18n:general Related to translations label Jun 9, 2026
@netlify

netlify Bot commented Jun 9, 2026

Copy link
Copy Markdown

Deploy Preview for superset-docs-preview ready!

Name Link
🔨 Latest commit a052f97
🔍 Latest deploy log https://app.netlify.com/projects/superset-docs-preview/deploys/6a28a82f74514000084d8383
😎 Deploy Preview https://deploy-preview-40919--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.

@codecov

codecov Bot commented Jun 10, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 80.00000% with 6 lines in your changes missing coverage. Please review.
✅ Project coverage is 64.10%. Comparing base (06f95f5) to head (2cc6bab).
⚠️ Report is 68 commits behind head on master.

Files with missing lines Patch % Lines
...lugin-chart-echarts/src/Sunburst/transformProps.ts 0.00% 3 Missing ⚠️
...ugin-chart-echarts/src/Waterfall/transformProps.ts 0.00% 2 Missing ⚠️
...lugin-chart-echarts/src/Treemap/EchartsTreemap.tsx 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master   #40919      +/-   ##
==========================================
- Coverage   64.14%   64.10%   -0.04%     
==========================================
  Files        2652     2653       +1     
  Lines      143482   143739     +257     
  Branches    33108    33152      +44     
==========================================
+ Hits        92037    92150     +113     
- Misses      49836    49971     +135     
- Partials     1609     1618       +9     
Flag Coverage Δ
hive 39.47% <100.00%> (-0.05%) ⬇️
javascript 67.86% <77.77%> (-0.01%) ⬇️
mysql 58.21% <100.00%> (-0.06%) ⬇️
postgres 58.28% <100.00%> (-0.06%) ⬇️
presto 41.07% <100.00%> (-0.06%) ⬇️
python 59.75% <100.00%> (-0.06%) ⬇️
sqlite 57.90% <100.00%> (-0.06%) ⬇️
unit 100.00% <ø> (ø)

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.

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

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Code Review Agent Run #f1b1a5

Actionable Suggestions - 1
  • superset-frontend/src/explore/components/controls/CollectionControl/CollectionControl.test.tsx - 1
Additional Suggestions - 3
  • superset-frontend/plugins/plugin-chart-echarts/src/constants.ts - 1
    • Missing Python backend constants · Line 32-35
      The diff adds TRUE_STRING and FALSE_STRING with a comment directing developers to also update constants.py, but these constants are missing from the Python backend file. The existing NULL_STRING and EMPTY_STRING are already mirrored in constants.py (lines 30-31), but TRUE_STRING and FALSE_STRING are not. This creates an inconsistency that could cause issues if backend code needs to reference these values.
  • superset-frontend/plugins/plugin-chart-echarts/src/Waterfall/transformProps.ts - 1
    • Dead code removal needed · Line 72-74
      The diff correctly changes `NULL_STRING` to `NULL_STRING()` (calling the function). However, the entire code block (lines 72-74) is dead code — after `return ''` at line 68, `series` is guaranteed truthy, making `if (!series)` at line 72 unreachable. The proper fix is to delete lines 72-74 entirely rather than fixing code that can never execute.
  • superset-frontend/src/components/FilterableTable/useCellContentParser.ts - 1
    • Inconsistent null label text · Line 25-25
      The `NULL_STRING` now returns `'NULL'` but `plugin-chart-echarts/src/constants.ts:33` uses `''` with angle brackets. Users may see inconsistent null representations depending on the displaying component.
Filtered by Review Rules

Bito filtered these suggestions based on rules created automatically for your feedback. Manage rules.

  • superset-frontend/plugins/plugin-chart-echarts/test/utils/series.test.ts - 1
Review Details
  • Files reviewed - 18 · Commit Range: a052f97..a052f97
    • superset-frontend/plugins/plugin-chart-echarts/src/Bubble/transformProps.ts
    • superset-frontend/plugins/plugin-chart-echarts/src/Sunburst/transformProps.ts
    • superset-frontend/plugins/plugin-chart-echarts/src/Treemap/EchartsTreemap.tsx
    • superset-frontend/plugins/plugin-chart-echarts/src/Waterfall/transformProps.ts
    • superset-frontend/plugins/plugin-chart-echarts/src/constants.ts
    • superset-frontend/plugins/plugin-chart-echarts/src/utils/series.ts
    • superset-frontend/plugins/plugin-chart-echarts/test/utils/series.test.ts
    • superset-frontend/src/components/FilterableTable/useCellContentParser.test.ts
    • superset-frontend/src/components/FilterableTable/useCellContentParser.ts
    • superset-frontend/src/components/FilterableTable/utils.tsx
    • superset-frontend/src/explore/components/controls/CollectionControl/CollectionControl.test.tsx
    • superset-frontend/src/explore/exploreUtils/getSimpleSQLExpression.test.ts
    • superset-frontend/src/filters/components/Select/SelectFilterPlugin.test.tsx
    • superset-frontend/src/filters/utils.test.ts
    • superset-frontend/src/filters/utils.ts
    • superset-frontend/src/utils/common.test.tsx
    • superset-frontend/src/utils/common.ts
    • superset/constants.py
  • Files skipped - 0
  • Tools
    • Whispers (Secret Scanner) - ✔︎ Successful
    • Detect-secrets (Secret Scanner) - ✔︎ Successful
    • Eslint (Linter) - ✔︎ Successful
    • MyPy (Static Code Analysis) - ✔︎ Successful
    • Astral Ruff (Static Code Analysis) - ✔︎ 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

import CollectionControl from '.';

jest.mock('@superset-ui/chart-controls', () => ({
...jest.requireActual('@superset-ui/chart-controls'),

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Mock targets non-existent export

The mock targets InfoTooltip from @superset-ui/chart-controls, but this component is not exported from that module. The actual source imports InfoTooltip from @superset-ui/core/components (see ControlHeader.tsx:22). This mock will have no effect and may cause test failures.

Code suggestion
Check the AI-generated fix before applying
 --- superset-frontend/src/explore/components/controls/CollectionControl/CollectionControl.test.tsx
 +++ superset-frontend/src/explore/components/controls/CollectionControl/CollectionControl.test.tsx
 @@ -19,7 +19,7 @@ import { render, screen, userEvent } from 'spec/helpers/testing-library';
  import CollectionControl from '.';
 
  jest.mock('@superset-ui/chart-controls', () => ({
 -  ...jest.requireActual('@superset-ui/chart-controls'),
 +  ...jest.requireActual('@superset-ui/chart-controls'),
    InfoTooltip: (props: any) => (
      <button
        onClick={props.onClick}
        type="button"
        data-icon={props.icon}
        data-tooltip={props.tooltip}
      >
        {props.label}
      </button>
    ),
  }));
 
  jest.mock('@superset-ui/core/components', () => ({
    ...jest.requireActual('@superset-ui/core/components'),
    InfoTooltip: (props: any) => (
      <button
        onClick={props.onClick}
        type="button"
        data-icon={props.icon}
        data-tooltip={props.tooltip}
      >
        {props.label}
      </button>
    ),
  }));

Code Review Run #f1b1a5


Should Bito avoid suggestions like this for future reviews? (Manage Rules)

  • Yes, avoid them

@nicob3y nicob3y force-pushed the feat/null-true-false-translatable branch from 2cc6bab to 8393ff8 Compare June 10, 2026 08:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

i18n:general Related to translations plugins size/L

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant