diff --git a/superset/db_engine_specs.py b/superset/db_engine_specs.py index 71c6ab20d9b6f..674e9f3b707d6 100644 --- a/superset/db_engine_specs.py +++ b/superset/db_engine_specs.py @@ -866,6 +866,18 @@ def convert_dttm(cls, target_type, dttm): class RedshiftEngineSpec(PostgresEngineSpec): engine = 'redshift' + + time_grains = ( + Grain("Time Column", _('Time Column'), "{col}"), + Grain("second", _('second'), "DATE_TRUNC('second', {col})"), + Grain("minute", _('minute'), "DATE_TRUNC('minute', {col})"), + Grain("hour", _('hour'), "DATE_TRUNC('hour', {col})"), + Grain("day", _('day'), "DATE_TRUNC('day', {col})"), + Grain("week", _('week'), "DATE_TRUNC('week', {col})"), + Grain("month", _('month'), "DATE_TRUNC('month', {col})"), + Grain("quarter", _('quarter'), "DATE_TRUNC('quarter', {col})"), + Grain("year", _('year'), "DATE_TRUNC('year', {col})"), + ) class OracleEngineSpec(PostgresEngineSpec):