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


   ### SUMMARY
   When a dashboard has both a native time range filter AND a filter box with a 
date filter, the native time range filter won't apply to charts, even if the 
filter box is set to "No filter". This is due to the filter box taking 
precedence over the native filter without evaluating if it's set or not.
   
   This PR changes this so that the filter box doesn't override the value of 
the native filter if its value is "No filter" (the constant `NO_TIME_RANGE`). 
This is done by checking that the filter box time range is set earlier in the 
code flow. This check was previously done when setting the filter indicator 
status - this logic and associated unit tests were removed as they're now 
handled upstream. However, if both are set, the filter box takes precedence as 
before. Unit tests are added to handle both cases.
   
   Closes #16839
   
   ### AFTER
   After this change the native time range filter applies properly:
   
![image](https://user-images.githubusercontent.com/33317356/134904062-2e212dd3-0c24-4d1d-8012-1f39d92d929f.png)
   
   
   ### BEFORE
   Currently the native time range filter doesn't apply to a chart if the 
dashboard has a filter box with a date filter (see the missing `year >= 1971` 
in the query):
   
![image](https://user-images.githubusercontent.com/33317356/134904152-8b097d0c-02c9-454b-9ac0-32e525dcfc48.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