villebro opened a new pull request #16460:
URL: https://github.com/apache/superset/pull/16460


   ### SUMMARY
   During migration of the Value filter to the new Select component, support 
for non-string based filter values (`number`, `boolean` and `null`) stopped 
working correctly. This fixes that
   
   Known limitations: Even with this fix `null` values won't be supported in 
single select mode. This is due to how the native filter framework interprets 
the special case of a filter value being unset when the value is `null` (in the 
"multiple select" mode the filter value is `[null]` which is interpreted as 
being set). We have a potential fix for this, but it will require a slightly 
bigger refactor to be fully supported.
   
   TODO: update type declarations on `superset-ui` to get rid of the 
`@ts-ignore`s.
   
   Dashboard with filters unset:
   
![image](https://user-images.githubusercontent.com/33317356/130928197-f49cb965-759d-41ad-8029-80ceb28edf33.png)
   
   ### AFTER
   
![image](https://user-images.githubusercontent.com/33317356/130927234-d7d6ef39-58c9-4c0b-b1a9-2a38faf31160.png)
   The query is now correctly issuing an `IS NULL` where clause:
   
![image](https://user-images.githubusercontent.com/33317356/130927964-ec05d849-c0ff-499c-9c1d-517f000e92e9.png)
   
   Now the values are also formatted correctly
   
![image](https://user-images.githubusercontent.com/33317356/130927337-836054e3-4a80-4d7e-a073-a5a40dc9869a.png)
   
   ### BEFORE
   Notice how `null` is interpreted as `false`:
   
![image](https://user-images.githubusercontent.com/33317356/130927537-00f3d132-ae16-40c0-85b1-0efc5242a9aa.png)
   Same in the query:
   
![image](https://user-images.githubusercontent.com/33317356/130927612-3ef04039-56e9-499b-92e8-3486577b46f1.png)
   
   ### TESTING INSTRUCTIONS
   <!--- Required! What steps can be taken to manually verify the changes? -->
   
   ### ADDITIONAL INFORMATION
   <!--- Check any relevant boxes with "x" -->
   <!--- HINT: Include "Fixes #nnn" if you are fixing an existing issue -->
   - [ ] Has associated issue:
   - [ ] Required feature flags:
   - [ ] 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
   


-- 
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