Skip to content

Commit

Permalink
Add second and minute grains (#7810)
Browse files Browse the repository at this point in the history
  • Loading branch information
villebro authored Jul 3, 2019
1 parent 0125ba4 commit 346638a
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions superset/db_engine_specs/sqlite.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ class SqliteEngineSpec(BaseEngineSpec):

time_grain_functions = {
None: "{col}",
"PT1S": "DATETIME(STRFTIME('%Y-%m-%dT%H:%M:%S', {col}))",
"PT1M": "DATETIME(STRFTIME('%Y-%m-%dT%H:%M:00', {col}))",
"PT1H": "DATETIME(STRFTIME('%Y-%m-%dT%H:00:00', {col}))",
"P1D": "DATE({col})",
"P1W": "DATE({col}, -strftime('%W', {col}) || ' days')",
Expand Down

0 comments on commit 346638a

Please sign in to comment.