Skip to content

Commit

Permalink
fixing issue apache#6572 with Oracle date handling (apache#6580)
Browse files Browse the repository at this point in the history
* fix Oracle engine specs for dates issue apache#6572

* fix Oracle engine specs for dates issue apache#6572

* fix Oracle engine specs for dates issue apache#6572, removing comment

* ng a trailing space
  • Loading branch information
ghsalem authored and Conglei Shi committed Jan 7, 2019
1 parent 17b5999 commit 925761d
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions superset/db_engine_specs.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 925761d

Please sign in to comment.