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/09/21 15:12:13 UTC

[GitHub] [incubator-superset] benvdh opened a new pull request #8276: [WIP] More intuitive display of negative time deltas (#8274)

benvdh opened a new pull request #8276: [WIP] More intuitive display of negative time deltas (#8274)
URL: https://github.com/apache/incubator-superset/pull/8276
 
 
   ### CATEGORY
   
   Choose one
   
   - [] Bug Fix
   - [x] Enhancement (new features, refinement)
   - [ ] Refactor
   - [x] Add tests
   - [ ] Build / Development Environment
   - [ ] Documentation
   
   ### SUMMARY
   This pull request changes the way negative time delta's are displayed. The default python display of a negative timedelta is rather unintuitive for a user of a dashboard. For example, -6 minutes is displayed as `'-1 day, 23:54:00`. This basically requires users to make time calculations in their heads to interpret the number correctly. This pull request changes the formatting to  '-0:06:00' at the code level and `-0 days 00:06:00` at the superset UI level to make it easier for users to interpret the time delta. More details on the issue and why this solution was chosen can be found in #8274 .
   
   ### BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
   The data in postgres looks like this:
   ![data_in_postgres](https://user-images.githubusercontent.com/4882376/65375052-6686f500-dc91-11e9-97b8-097f64ae594c.png)
   
   Before this pull request the data looks like this in superset:
   ![data_in_superset_table_before](https://user-images.githubusercontent.com/4882376/65375140-6d623780-dc92-11e9-8165-661eb0fd9ea2.png)
   
   Afterwards it looks like this in superset:
   ![data_in_superset_table_after](https://user-images.githubusercontent.com/4882376/65375109-05135600-dc92-11e9-9e9d-30a195465be9.png)
   
   ### TEST PLAN
   - The unit test for base_json_conv() has been enhanced to handle timedelta's as well
   - A new function has been added in superset.utils.core named `timedelta_f` which is called in base_json_conv() (same module). A new test has been added to test this formatting function.
   
   ### ADDITIONAL INFORMATION
   <!--- Check any relevant boxes with "x" -->
   <!--- HINT: Include "Fixes #nnn" if you are fixing an existing issue -->
   - [x] Has associated issue: #8274 
   - [ ] Changes UI
   - [ ] Requires DB Migration.
   - [ ] Confirm DB Migration upgrade and downgrade tested.
   - [ ] Introduces new feature or API
   - [ ] Removes existing feature or API
   
   ### REVIEWERS
   

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