You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@superset.apache.org by "mistercrunch (via GitHub)" <gi...@apache.org> on 2026/04/07 20:18:44 UTC
[PR] fix(explore): handle boolean false values correctly in control rendering [superset]
mistercrunch opened a new pull request, #39172:
URL: https://github.com/apache/superset/pull/39172
### SUMMARY
Fixes multiple JS truthiness bugs where boolean `false` was treated as falsy/empty, causing incorrect rendering in explore view controls:
- **ConditionalFormattingControl**: Unary operators (`is false`, `is true`, `is null`, `is not null`) rendered with trailing `undefined` in their label because the `createLabel` switch had no cases for them
- **AdhocFilterEditPopoverSimpleTabContent**: `comparator && ...` short-circuited on `false`, treating it as "no value"; `.filter(element => element)` dropped `false` when converting single to multi-value operators
- **getSimpleSQLExpression**: `Number(false)` = `0` caused boolean comparator values to be treated as numeric instead of string, omitting proper quoting
### BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
**Before:**
- Conditional formatting label: `column_name is false undefined`
- Filter comparator `false` dropped when switching from `=` to `IN` operator
- SQL expression: `column = FALSE` (unquoted)
**After:**
- Conditional formatting label: `column_name is false`
- Filter comparator `false` preserved across operator changes
- SQL expression: `column = 'FALSE'` (properly quoted)
### TESTING INSTRUCTIONS
1. Create a chart with a boolean column
2. Add conditional formatting → select a boolean column → choose "is false" operator → verify the label shows `column_name is false` (no trailing "undefined")
3. Add an adhoc filter → select a boolean column → set comparator to `false` → switch operator from `=` to `IN` → verify `false` value is preserved
4. Verify the filter pill label shows proper quoting for boolean values
### ADDITIONAL INFORMATION
- [ ] Has associated issue:
- [ ] Required feature flags:
- [x] Changes UI
- [ ] Includes DB Migration (follow approval process in [SIP-59](https://github.com/apache/superset/issues/13351))
- [ ] 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
🤖 Generated with [Claude Code](https://claude.com/claude-code)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [PR] fix(explore): handle boolean false values correctly in control rendering [superset]
Posted by "mistercrunch (via GitHub)" <gi...@apache.org>.
mistercrunch commented on PR #39172:
URL: https://github.com/apache/superset/pull/39172#issuecomment-4202909044
@rusackas Done! Added `ConditionalFormattingControl.test.tsx` with 5 tests covering the `createLabel` path for all unary operators:
- `is false`, `is true`, `is null`, `is not null` — verifies no trailing "undefined"
- verbose column name mapping — verifies `verboseMap` is applied correctly
Also added a test in `AdhocFilterEditPopoverSimpleTabContent.test.tsx` for boolean `false` comparator preservation on operator change (the `.filter()` fix).
Ready for re-review when you get a chance!
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [PR] fix(explore): handle boolean false values correctly in control rendering [superset]
Posted by "codecov[bot] (via GitHub)" <gi...@apache.org>.
codecov[bot] commented on PR #39172:
URL: https://github.com/apache/superset/pull/39172#issuecomment-4202060512
## [Codecov](https://app.codecov.io/gh/apache/superset/pull/39172?dropdown=coverage&src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) Report
:x: Patch coverage is `50.00000%` with `5 lines` in your changes missing coverage. Please review.
:white_check_mark: Project coverage is 64.45%. Comparing base ([`5f9fc31`](https://app.codecov.io/gh/apache/superset/commit/5f9fc31ae23cc25e7892780ccdcc17ab29bcc61a?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)) to head ([`d1b82ce`](https://app.codecov.io/gh/apache/superset/commit/d1b82ceff919a93550c0d21ad92e08e19a73746a?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)).
| [Files with missing lines](https://app.codecov.io/gh/apache/superset/pull/39172?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | Patch % | Lines |
|---|---|---|
| [...FormattingControl/ConditionalFormattingControl.tsx](https://app.codecov.io/gh/apache/superset/pull/39172?src=pr&el=tree&filepath=superset-frontend%2Fsrc%2Fexplore%2Fcomponents%2Fcontrols%2FConditionalFormattingControl%2FConditionalFormattingControl.tsx&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2V4cGxvcmUvY29tcG9uZW50cy9jb250cm9scy9Db25kaXRpb25hbEZvcm1hdHRpbmdDb250cm9sL0NvbmRpdGlvbmFsRm9ybWF0dGluZ0NvbnRyb2wudHN4) | 0.00% | [5 Missing :warning: ](https://app.codecov.io/gh/apache/superset/pull/39172?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) |
<details><summary>Additional details and impacted files</summary>
```diff
@@ Coverage Diff @@
## master #39172 +/- ##
==========================================
- Coverage 64.45% 64.45% -0.01%
==========================================
Files 2541 2541
Lines 131662 131669 +7
Branches 30517 30523 +6
==========================================
+ Hits 84863 84865 +2
- Misses 45333 45338 +5
Partials 1466 1466
```
| [Flag](https://app.codecov.io/gh/apache/superset/pull/39172/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | Coverage Δ | |
|---|---|---|
| [javascript](https://app.codecov.io/gh/apache/superset/pull/39172/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `66.05% <50.00%> (-0.01%)` | :arrow_down: |
Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#carryforward-flags-in-the-pull-request-comment) to find out more.
</details>
[:umbrella: View full report in Codecov by Sentry](https://app.codecov.io/gh/apache/superset/pull/39172?dropdown=coverage&src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).
:loudspeaker: Have feedback on the report? [Share it here](https://about.codecov.io/codecov-pr-comment-feedback/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).
<details><summary> :rocket: New features to boost your workflow: </summary>
- :snowflake: [Test Analytics](https://docs.codecov.com/docs/test-analytics): Detect flaky tests, report on failures, and find test suite problems.
- :package: [JS Bundle Analysis](https://docs.codecov.com/docs/javascript-bundle-analysis): Save yourself from yourself by tracking and limiting bundle sizes in JS merges.
</details>
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [PR] fix(explore): handle boolean false values correctly in control rendering [superset]
Posted by "bito-code-review[bot] (via GitHub)" <gi...@apache.org>.
bito-code-review[bot] commented on PR #39172:
URL: https://github.com/apache/superset/pull/39172#issuecomment-4203107705
AI Code Review is in progress (usually takes 3 to 15 minutes unless it's a very large PR).
<details>
<summary>
Bito Usage Guide
</summary>
**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 <a href="https://docs.bito.ai/bito-dev-agents/ai-code-review-agent/available-commands" target="_blank" rel="noopener noreferrer">documentation</a> for additional commands.
**Configuration**
This repository uses `Superset` You can customize the agent settings <a href="https://alpha.bito.ai/home/ai-agents/code-review-agent" target="_blank" rel="noopener noreferrer">here</a> or contact your Bito workspace admin at evan@preset.io.
**Documentation & Help**
- <a href="https://docs.bito.ai/bito-dev-agents/ai-code-review-agent/getting-started/install-run-using-bito-cloud/create-or-customize-an-agent-instance" target="_blank" rel="noopener noreferrer">Customize agent settings</a>
- <a href="https://docs.bito.ai/bito-dev-agents/ai-code-review-agent/implementing-custom-code-review-rules" target="_blank" rel="noopener noreferrer">Review rules</a>
- <a href="https://docs.bito.ai/bito-dev-agents/ai-code-review-agent" target="_blank" rel="noopener noreferrer">General documentation</a>
- <a href="https://docs.bito.ai/bito-dev-agents/ai-code-review-agent/faqs" target="_blank" rel="noopener noreferrer">FAQ</a>
</details>
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [PR] fix(explore): handle boolean false values correctly in control rendering [superset]
Posted by "bito-code-review[bot] (via GitHub)" <gi...@apache.org>.
bito-code-review[bot] commented on PR #39172:
URL: https://github.com/apache/superset/pull/39172#issuecomment-4201939512
AI Code Review is in progress (usually takes 3 to 15 minutes unless it's a very large PR).
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [PR] fix(explore): handle boolean false values correctly in control rendering [superset]
Posted by "netlify[bot] (via GitHub)" <gi...@apache.org>.
netlify[bot] commented on PR #39172:
URL: https://github.com/apache/superset/pull/39172#issuecomment-4202884715
### <span aria-hidden="true">✅</span> Deploy Preview for *superset-docs-preview* ready!
| Name | Link |
|:-:|------------------------|
|<span aria-hidden="true">🔨</span> Latest commit | 98522a19b0d8cb8d281d02bb3e49dfaba1250668 |
|<span aria-hidden="true">🔍</span> Latest deploy log | https://app.netlify.com/projects/superset-docs-preview/deploys/69d5984c28a828000889e460 |
|<span aria-hidden="true">😎</span> Deploy Preview | [https://deploy-preview-39172--superset-docs-preview.netlify.app](https://deploy-preview-39172--superset-docs-preview.netlify.app) |
|<span aria-hidden="true">📱</span> Preview on mobile | <details><summary> Toggle QR Code... </summary><br /><br /><br /><br />_Use your smartphone camera to open QR code link._</details> |
---
<!-- [superset-docs-preview Preview](https://deploy-preview-39172--superset-docs-preview.netlify.app) -->
_To edit notification comments on pull requests, go to your [Netlify project configuration](https://app.netlify.com/projects/superset-docs-preview/configuration/notifications#deploy-notifications)._
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [PR] fix(explore): handle boolean false values correctly in control rendering [superset]
Posted by "Copilot (via GitHub)" <gi...@apache.org>.
Copilot commented on code in PR #39172:
URL: https://github.com/apache/superset/pull/39172#discussion_r3047730322
##########
superset-frontend/src/explore/components/controls/FilterControl/AdhocFilterEditPopoverSimpleTabContent/index.tsx:
##########
@@ -396,7 +396,8 @@ const AdhocFilterEditPopoverSimpleTabContent: FC<Props> = props => {
};
const comparatorHasValue =
- comparator &&
+ comparator != null &&
+ comparator !== '' &&
(Array.isArray(comparator)
? comparator.length > 0
: String(comparator).length > 0);
Review Comment:
`comparatorHasValue` was updated to treat `false` as a valid value. Since this affects placeholder/label rendering for the comparator control, it would be good to add a focused test that renders the component with `comparator=false` and asserts the UI/placeholder state matches expectations (i.e., it is treated as populated).
##########
superset-frontend/src/explore/components/controls/FilterControl/AdhocFilterEditPopoverSimpleTabContent/index.tsx:
##########
@@ -199,7 +199,7 @@ export const useSimpleTabFilterProps = (props: Props) => {
if (MULTI_OPERATORS.has(operatorId)) {
newComparator = Array.isArray(currentComparator)
? currentComparator
- : [currentComparator].filter(element => element);
+ : [currentComparator].filter(element => element != null);
} else {
Review Comment:
The boolean-false handling here changes behavior in two places (single→multi comparator conversion and `comparatorHasValue`), but the existing test suite for this component doesn’t cover a `false` comparator. Please add/extend a unit test to assert that switching to a multi operator preserves `false` (and that `comparatorHasValue` treats `false` as having a value), to prevent regressions back to truthiness-based dropping.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [PR] fix(explore): handle boolean false values correctly in control rendering [superset]
Posted by "rusackas (via GitHub)" <gi...@apache.org>.
rusackas commented on PR #39172:
URL: https://github.com/apache/superset/pull/39172#issuecomment-4202160149
One ask before merging: the createLabel fix in ConditionalFormattingControl.tsx (the new case Comparator.IsTrue / IsFalse / IsNull / IsNotNull block) has 0% unit test coverage per Codecov. Since label generation is pure/synchronous and the function is already exported, this should be straightforward to test — something like:
```
expect(createLabel('my_col', Comparator.IsTrue, '')).toBe('my_col is true');
expect(createLabel('my_col', Comparator.IsNull, '')).toBe('my_col is null');
```
Can you add a few cases to cover that path? Everything else looks good, standing by to approve otherwise :D
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [PR] fix(explore): handle boolean false values correctly in control rendering [superset]
Posted by "mistercrunch (via GitHub)" <gi...@apache.org>.
mistercrunch merged PR #39172:
URL: https://github.com/apache/superset/pull/39172
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [PR] fix(explore): handle boolean false values correctly in control rendering [superset]
Posted by "bito-code-review[bot] (via GitHub)" <gi...@apache.org>.
bito-code-review[bot] commented on PR #39172:
URL: https://github.com/apache/superset/pull/39172#issuecomment-4202556814
AI Code Review is in progress (usually takes 3 to 15 minutes unless it's a very large PR).
<details>
<summary>
Bito Usage Guide
</summary>
**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 <a href="https://docs.bito.ai/bito-dev-agents/ai-code-review-agent/available-commands" target="_blank" rel="noopener noreferrer">documentation</a> for additional commands.
**Configuration**
This repository uses `Superset` You can customize the agent settings <a href="https://alpha.bito.ai/home/ai-agents/code-review-agent" target="_blank" rel="noopener noreferrer">here</a> or contact your Bito workspace admin at evan@preset.io.
**Documentation & Help**
- <a href="https://docs.bito.ai/bito-dev-agents/ai-code-review-agent/getting-started/install-run-using-bito-cloud/create-or-customize-an-agent-instance" target="_blank" rel="noopener noreferrer">Customize agent settings</a>
- <a href="https://docs.bito.ai/bito-dev-agents/ai-code-review-agent/implementing-custom-code-review-rules" target="_blank" rel="noopener noreferrer">Review rules</a>
- <a href="https://docs.bito.ai/bito-dev-agents/ai-code-review-agent" target="_blank" rel="noopener noreferrer">General documentation</a>
- <a href="https://docs.bito.ai/bito-dev-agents/ai-code-review-agent/faqs" target="_blank" rel="noopener noreferrer">FAQ</a>
</details>
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org