superset-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From christ...@apache.org
Subject [incubator-superset] branch lyftga updated: Allow bigint to be used as time column in Presto (#7218)
Date Wed, 03 Apr 2019 19:43:51 GMT
This is an automated email from the ASF dual-hosted git repository.

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


The following commit(s) were added to refs/heads/lyftga by this push:
     new 6998b10  Allow bigint to be used as time column in Presto (#7218)
6998b10 is described below

commit 6998b1014a2341af51d8720a4a371fc6a2042a6e
Author: Beto Dealmeida <roberto@dealmeida.net>
AuthorDate: Wed Apr 3 12:43:39 2019 -0700

    Allow bigint to be used as time column in Presto (#7218)
---
 superset/db_engine_specs.py | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/superset/db_engine_specs.py b/superset/db_engine_specs.py
index 8be1a21..9eee7c5 100644
--- a/superset/db_engine_specs.py
+++ b/superset/db_engine_specs.py
@@ -832,6 +832,8 @@ class PrestoEngineSpec(BaseEngineSpec):
             return "from_iso8601_date('{}')".format(dttm.isoformat()[:10])
         if tt == 'TIMESTAMP':
             return "from_iso8601_timestamp('{}')".format(dttm.isoformat())
+        if tt == 'BIGINT':
+            return "to_unixtime(from_iso8601_timestamp('{}'))".format(dttm.isoformat())
         return "'{}'".format(dttm.strftime('%Y-%m-%d %H:%M:%S'))
 
     @classmethod


Mime
View raw message