superset-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From maximebeauche...@apache.org
Subject [incubator-superset] branch master updated: fixing issue #6572 with Oracle date handling (#6580)
Date Fri, 28 Dec 2018 16:51:55 GMT
This is an automated email from the ASF dual-hosted git repository.

maximebeauchemin 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 f761237  fixing issue #6572 with Oracle date handling (#6580)
f761237 is described below

commit f761237260f5d14833bf20992b1fcfe7e031b794
Author: ghsalem <36957206+ghsalem@users.noreply.github.com>
AuthorDate: Fri Dec 28 17:51:48 2018 +0100

    fixing issue #6572 with Oracle date handling (#6580)
    
    * fix Oracle engine specs for dates issue #6572
    
    * fix Oracle engine specs for dates issue #6572
    
    * fix Oracle engine specs for dates issue #6572, removing comment
    
    * ng a trailing space
---
 superset/db_engine_specs.py | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/superset/db_engine_specs.py b/superset/db_engine_specs.py
index 772dda6..7cf4a51 100644
--- a/superset/db_engine_specs.py
+++ b/superset/db_engine_specs.py
@@ -485,13 +485,13 @@ class OracleEngineSpec(PostgresBaseEngineSpec):
     time_grain_functions = {
         None: '{col}',
         'PT1S': 'CAST({col} as DATE)',
-        'PT1M': "TRUNC(TO_DATE({col}), 'MI')",
-        'PT1H': "TRUNC(TO_DATE({col}), 'HH')",
-        'P1D': "TRUNC(TO_DATE({col}), 'DDD')",
-        'P1W': "TRUNC(TO_DATE({col}), 'WW')",
-        'P1M': "TRUNC(TO_DATE({col}), 'MONTH')",
-        'P0.25Y': "TRUNC(TO_DATE({col}), 'Q')",
-        'P1Y': "TRUNC(TO_DATE({col}), 'YEAR')",
+        'PT1M': "TRUNC(CAST({col} as DATE), 'MI')",
+        'PT1H': "TRUNC(CAST({col} as DATE), 'HH')",
+        'P1D': "TRUNC(CAST({col} as DATE), 'DDD')",
+        'P1W': "TRUNC(CAST({col} as DATE), 'WW')",
+        'P1M': "TRUNC(CAST({col} as DATE), 'MONTH')",
+        'P0.25Y': "TRUNC(CAST({col} as DATE), 'Q')",
+        'P1Y': "TRUNC(CAST({col} as DATE), 'YEAR')",
     }
 
     @classmethod


Mime
View raw message