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

   ### SUMMARY
   <!--- Describe the change below, including rationale and design decisions -->
   
   First change to complete https://github.com/apache/superset/issues/13125: We 
add a new configuration `DEFAULT_TIME_FILTER` to allow admins to set a global 
default time filter for any new explore charts. By default this is set to 
`None`, which replicates the previous behavior (`"No filter"`). To get a 
default filter of -1w the configuration can be set to `'Last week'` or any 
other value understood by Superset.
   
   There is a minor change in behavior `UPDATE_FORM_DATA_BY_DATASOURCE` (when 
switching dataset in explore), the time filter is not reset anymore. This is 
similar to the behavior of other globally configured filters such as the row 
limit for explore, which also do not reset.
   
   ### BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
   <!--- Skip this if not applicable -->
   New explore chart with `DEFAULT_TIME_FILTER = None`:
   <img 
src="https://user-images.githubusercontent.com/1842905/196846013-317773cd-21e7-4ee3-889c-a16803874426.png";
 width="200">
   New explore chart with `DEFAULT_TIME_FILTER = "Last week"`:
   <img 
src="https://user-images.githubusercontent.com/1842905/196845999-d4838206-18d8-4ba3-bbdc-a9d93bed3957.png";
 width="200">
   
   ### TESTING INSTRUCTIONS
   
   #### Test default behavior
   1. Go to datasets and click on users (example dataset)
   2. Add `updated` (time) as a dimension (helps to verify)
   
   **Expected**: No time filter is applied when running the chart
   
   #### Test with new configuration
   1. Set `DEFAULT_TIME_FILTER = "2020-06-01T00:00:00 : now"` in `config.py`
   2. Go to datasets and click on users (example dataset)
   4. Add `updated` (time) as dimension (helps to verify)
   
   **Expected**: Default time filter is applied
   
   ### ADDITIONAL INFORMATION
   <!--- Check any relevant boxes with "x" -->
   <!--- HINT: Include "Fixes #nnn" if you are fixing an existing issue -->
   - [x] Has associated issue: https://github.com/apache/superset/issues/13125
   - [ ] 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
   - [x] 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