diff --git a/superset/db_engine_specs/postgres.py b/superset/db_engine_specs/postgres.py index c5ffc79ee7100..4b8a731d31fa4 100644 --- a/superset/db_engine_specs/postgres.py +++ b/superset/db_engine_specs/postgres.py @@ -84,14 +84,14 @@ class PostgresBaseEngineSpec(BaseEngineSpec): _time_grain_expressions = { None: "{col}", - "PT1S": "DATE_TRUNC('second', {col})", - "PT1M": "DATE_TRUNC('minute', {col})", - "PT1H": "DATE_TRUNC('hour', {col})", - "P1D": "DATE_TRUNC('day', {col})", - "P1W": "DATE_TRUNC('week', {col})", - "P1M": "DATE_TRUNC('month', {col})", - "P3M": "DATE_TRUNC('quarter', {col})", - "P1Y": "DATE_TRUNC('year', {col})", + "PT1S": "DATE_TRUNC('second', {col})||':00'", + "PT1M": "DATE_TRUNC('minute', {col})||':00'", + "PT1H": "DATE_TRUNC('hour', {col})||':00'", + "P1D": "DATE_TRUNC('day', {col})||':00'", + "P1W": "DATE_TRUNC('week', {col})||':00'", + "P1M": "DATE_TRUNC('month', {col})||':00'", + "P3M": "DATE_TRUNC('quarter', {col})||':00'", + "P1Y": "DATE_TRUNC('year', {col})||':00'", } custom_errors: Dict[Pattern[str], Tuple[str, SupersetErrorType, Dict[str, Any]]] = {