sadpandajoe opened a new pull request, #43317:
URL: https://github.com/apache/superset/pull/43317

   ### SUMMARY
   Adhoc filter validation (`AdhocFilter.isValid()`) only rejected a `null` 
comparator, so an unset (`undefined`) comparator passed validation and left the 
Save button enabled. This is most visible on Boolean-column filters: Boolean 
columns are restricted to unary operators, but the subject-change handler still 
defaulted a fresh filter's operator to `IN` (never actually selectable for 
Boolean columns), leaving the comparator `undefined` with no way to set it 
through the UI. Saving a filter in that state and running the chart surfaced a 
generic, unhelpful error instead of a clear validation message.
   
   This change tightens the check from `!== null` to `!= null`, which also 
catches the `undefined` case while still accepting legitimate falsy values like 
`false` and `0`.
   
   ### BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
   N/A for this PR body; may be added as a follow-up comment once environment 
QA evidence is captured.
   
   ### TESTING INSTRUCTIONS
   1. In Explore, add a simple adhoc filter on a boolean column.
   2. Leave the value unset.
   3. Before this change: Save is enabled, and running the chart returns a 
generic error.
   4. After this change: Save is disabled until a value is selected.
   
   Automated coverage: `AdhocFilter.test.ts` and 
`AdhocFilterEditPopover.test.tsx` (new cases covering an unset comparator).
   
   ### ADDITIONAL INFORMATION
   - [ ] Has associated issue:
   - [ ] Required feature flags:
   - [x] 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
   


-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to