villebro opened a new pull request #13000: URL: https://github.com/apache/superset/pull/13000
### SUMMARY Currently cascading filters evaluate truthiness of the parent filter when determining if the child filter should be rendered in place of the parent. Since the native Select filter returns an empty array for an empty selection, the parent filter is determined to be set, even though it isn't. Here we change the cascading logic so that only `undefined` and `null` are assumed to be unset. This is done because there may be other filters that have falsy values which in fact mean that the filter is set, for instance a lower range being set to `0`. ### SCREENSHOTS In the example, I've constructed a cascading filter with "region" as the parent and "country" as the child. As can be seen, the "country" filter show up on the filter tab, despite the selection being empty on the "region" filter:  After the change, an empty selection is set as `null`, making the parent filter display in the filter tab:  ### TEST PLAN <!--- What steps should be taken to 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: - [ ] Changes UI - [ ] Requires DB Migration. - [ ] Confirm DB Migration upgrade and downgrade tested. - [ ] 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. For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
