You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@superset.apache.org by GitBox <gi...@apache.org> on 2019/05/14 20:47:26 UTC

[GitHub] [incubator-superset] betodealmeida opened a new pull request #7508: Validate start/end when scheduling queries

betodealmeida opened a new pull request #7508: Validate start/end when scheduling queries
URL: https://github.com/apache/incubator-superset/pull/7508
 
 
   ### CATEGORY
   
   Choose one
   
   - [ ] Bug Fix
   - [X] Enhancement (new features, refinement)
   - [ ] Refactor
   - [ ] Add tests
   - [ ] Build / Development Environment
   - [ ] Documentation
   
   ### SUMMARY
   <!--- Describe the change below, including rationale and design decisions -->
   
   This PR adds validation to start and end dates when scheduling queries in SQL Lab, ensuring that the end date doesn't come before the start date.
   
   It also initializes the form with defaults. Ideally we want these to be relative dates, so I used the [Sugar](https://sugarjs.com/) library to parse human readable dates. For example, with this config:
   
   ```python
               'start_date': {
                   'type': 'string',
                   'format': 'date-time',
                   'title': 'Start date',
                   'default': 'today at 9am',
               },
               'end_date': {
                   'type': 'string',
                   'format': 'date-time',
                   'title': 'End date',
                   'default': '9am in 30 days',
               },
   ```
   
   We get:
   
   <img width="577" alt="Screen Shot 2019-05-14 at 1 38 31 PM" src="https://user-images.githubusercontent.com/1534870/57730673-d6370480-764d-11e9-873d-559471416bf8.png">
   
   <!-- ### BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF -->
   <!--- Skip this if not applicable -->
   
   ### TEST PLAN
   <!--- What steps should be taken to verify the changes -->
   
   Tested locally:
   
   <img width="587" alt="Screen Shot 2019-05-14 at 1 46 01 PM" src="https://user-images.githubusercontent.com/1534870/57731048-a76d5e00-764e-11e9-86f4-cd83cbf6feaf.png">
   
   
   ### 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.
   - [X] Introduces new feature or API
   - [ ] Removes existing feature or API
   
   ### REVIEWERS
   
   @DiggidyDave @khtruong @datability-io 

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org