superset-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <>
Subject [GitHub] [incubator-superset] benvdh opened a new pull request #8276: [WIP] More intuitive display of negative time deltas (#8274)
Date Sat, 21 Sep 2019 15:12:13 GMT
benvdh opened a new pull request #8276: [WIP] More intuitive display of negative time deltas
   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 .
   The data in postgres looks like this:
   Before this pull request the data looks like this in superset:
   Afterwards it looks like this in superset:
   ### 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.
   <!--- 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

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:

With regards,
Apache Git Services

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message