superset-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ville...@apache.org
Subject [incubator-superset] branch master updated: Add epoch funcs for BigQuery (#7567)
Date Sat, 08 Jun 2019 03:02:14 GMT
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 38abf4e  Add epoch funcs for BigQuery (#7567)
38abf4e is described below

commit 38abf4e07383e9ba14c50cb695edfd0868c2215f
Author: Ville Brofeldt <33317356+villebro@users.noreply.github.com>
AuthorDate: Fri Jun 7 20:01:58 2019 -0700

    Add epoch funcs for BigQuery (#7567)
---
 superset/db_engine_specs.py | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/superset/db_engine_specs.py b/superset/db_engine_specs.py
index 922e7cc..e0b2035 100644
--- a/superset/db_engine_specs.py
+++ b/superset/db_engine_specs.py
@@ -2421,6 +2421,14 @@ class BQEngineSpec(BaseEngineSpec):
         return [sqla.literal_column(c.get('name')).label(c.get('name').replace('.', '__'))
                 for c in cols]
 
+    @classmethod
+    def epoch_to_dttm(cls):
+        return 'TIMESTAMP_SECONDS({col})'
+
+    @classmethod
+    def epoch_ms_to_dttm(cls):
+        return 'TIMESTAMP_MILLIS({col})'
+
 
 class ImpalaEngineSpec(BaseEngineSpec):
     """Engine spec for Cloudera's Impala"""


Mime
View raw message