This is an automated email from the ASF dual-hosted git repository.

villebro pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-superset.git


The following commit(s) were added to refs/heads/master by this push:
     new 346638a  Add second and minute grains (#7810)
346638a is described below

commit 346638a339039b81ec40e314c9729e449baaa838
Author: Ville Brofeldt <[email protected]>
AuthorDate: Wed Jul 3 23:04:34 2019 +0300

    Add second and minute grains (#7810)
---
 superset/db_engine_specs/sqlite.py | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/superset/db_engine_specs/sqlite.py 
b/superset/db_engine_specs/sqlite.py
index a9be6a2..b6afbd9 100644
--- a/superset/db_engine_specs/sqlite.py
+++ b/superset/db_engine_specs/sqlite.py
@@ -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')",

Reply via email to