From 0dff6a9030d8f2ff7a03654258f3b02f01d9d57e Mon Sep 17 00:00:00 2001 From: Riccardo Magliocchetti Date: Tue, 18 Oct 2016 03:32:47 +0200 Subject: [PATCH] Add quarter time grain to postgresql (#1362) The timestamp returned is the start date of the period. Reference: https://www.postgresql.org/docs/9.1/static/functions-datetime.html --- caravel/db_engine_specs.py | 1 + 1 file changed, 1 insertion(+) diff --git a/caravel/db_engine_specs.py b/caravel/db_engine_specs.py index fa8f7e67ee..1cf1b8cfa1 100644 --- a/caravel/db_engine_specs.py +++ b/caravel/db_engine_specs.py @@ -56,6 +56,7 @@ class PostgresEngineSpec(BaseEngineSpec): 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})"), )