Skip to content

fix: allow comma typing in D3 format for Table chart#37740

Closed
RamiNoodle733 wants to merge 2 commits intoapache:masterfrom
RamiNoodle733:fix-d3-format-comma-typing
Closed

fix: allow comma typing in D3 format for Table chart#37740
RamiNoodle733 wants to merge 2 commits intoapache:masterfrom
RamiNoodle733:fix-d3-format-comma-typing

Conversation

@RamiNoodle733
Copy link

Add commaChoosesOption: false to d3NumberFormat and d3TimeFormat controls in ColumnConfigControl to prevent comma from triggering option selection.

Fixes #37038

RamiR added 2 commits February 6, 2026 01:34
Add .copy() after dropna() to prevent pandas SettingWithCopyWarning
when modifying the DataFrame column.

Fixes apache#36530
Add commaChoosesOption: false to d3NumberFormat and d3TimeFormat
controls in ColumnConfigControl to prevent comma from triggering
option selection.

Fixes apache#37038
@bito-code-review
Copy link
Contributor

bito-code-review bot commented Feb 6, 2026

Code Review Agent Run #b3d15f

Actionable Suggestions - 0
Additional Suggestions - 2
  • superset-frontend/src/explore/components/controls/ColumnConfigControl/constants.tsx - 2
    • Unsupported Select Prop · Line 61-61
      Remove the commaChoosesOption prop since it's not supported by Ant Design Select v5.26.0 and has no effect.
    • Unsupported Select Prop · Line 76-76
      Remove the commaChoosesOption prop since it's not supported by Ant Design Select v5.26.0 and has no effect.
Review Details
  • Files reviewed - 2 · Commit Range: c0610b6..f31bdbf
    • superset-frontend/src/explore/components/controls/ColumnConfigControl/constants.tsx
    • superset/utils/pandas_postprocessing/histogram.py
  • Files skipped - 0
  • Tools
    • Whispers (Secret Scanner) - ✔︎ Successful
    • Detect-secrets (Secret Scanner) - ✔︎ 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

@dosubot dosubot bot added the explore:control Related to the controls panel of Explore label Feb 6, 2026

# drop empty values from the target column
df = df.dropna(subset=[column])
df = df.dropna(subset=[column]).copy()
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggestion: Dropping NaN rows from the entire DataFrame before grouping removes groups that only contain null values in the target column, so those groups will disappear from the histogram output instead of being represented with zero counts, which breaks the documented "each row corresponds to a group" contract. [logic error]

Severity Level: Major ⚠️
- ❌ superset/utils/pandas_postprocessing/histogram.histogram() omits groups.
- ⚠️ Grouped histogram outputs have missing group rows.
- ⚠️ Downstream consumers receive fewer rows than expected.
Suggested change
df = df.dropna(subset=[column]).copy()
# NaN values in the target column are dropped later in hist_values(), so keep all rows here
Steps of Reproduction ✅
1. Create a DataFrame file and call the function `histogram()` defined in
`superset/utils/pandas_postprocessing/histogram.py` (function signature at lines 24-31).

2. Prepare input DataFrame where one group has only nulls, e.g.:

   - DataFrame with columns `group` and `value` where group "B" rows exist but `value` is
   NaN for all "B" rows.

3. Call histogram(df, column="value", groupby=["group"]) -> execution reaches the line
that pre-filters nulls at line 52: `df = df.dropna(subset=[column]).copy()`.

4. Rows for group "B" are removed by that dropna at line 52, so later grouping (code paths
at lines 81-86: the df.groupby(...) branch) never sees group "B" and no output row for "B"
is produced. The helper `hist_values` (lines 71-74) which drops NaNs inside a group's
Series is never given a chance to generate a zero-count vector for an absent group.

Explanation: The current code intentionally removes rows with NaN at line 52; that causes
groups whose only rows had NaN in the target column to disappear instead of appearing with
zero-count bins.
Prompt for AI Agent 🤖
This is a comment left during a code review.

**Path:** superset/utils/pandas_postprocessing/histogram.py
**Line:** 52:52
**Comment:**
	*Logic Error: Dropping NaN rows from the entire DataFrame before grouping removes groups that only contain null values in the target column, so those groups will disappear from the histogram output instead of being represented with zero counts, which breaks the documented "each row corresponds to a group" contract.

Validate the correctness of the flagged issue. If correct, How can I resolve this? If you propose a fix, implement it and please make it concise.

@netlify
Copy link

netlify bot commented Feb 6, 2026

Deploy Preview for superset-docs-preview ready!

Name Link
🔨 Latest commit f31bdbf
🔍 Latest deploy log https://app.netlify.com/projects/superset-docs-preview/deploys/69859af99013bc0008ef18be
😎 Deploy Preview https://deploy-preview-37740--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.

@sadpandajoe
Copy link
Member

closing since there are multiple PRs for this fix. It looks like the same pr may have been opened multiple times.

@sadpandajoe sadpandajoe closed this Feb 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

explore:control Related to the controls panel of Explore size/XS

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Not able to type comma (,) in D3 format for Table chart

2 participants