From e99cabbbc6c1697db3fd8869f75c002a5a28a5dc Mon Sep 17 00:00:00 2001 From: Ville Brofeldt Date: Tue, 21 May 2019 17:20:36 +0300 Subject: [PATCH] Add epoch funcs for BigQuery --- 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 35a591fa10202..6b8e702745510 100644 --- a/superset/db_engine_specs.py +++ b/superset/db_engine_specs.py @@ -1957,6 +1957,14 @@ def _get_fields(cls, cols): 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"""