You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@superset.apache.org by ma...@apache.org on 2018/12/28 16:51:55 UTC

[incubator-superset] branch master updated: fixing issue #6572 with Oracle date handling (#6580)

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 <36...@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