From ac0d85d7ebd53809a10ec144bf271c0657aa7f64 Mon Sep 17 00:00:00 2001 From: FaisalMaqbool Date: Thu, 10 Aug 2023 05:35:50 +0500 Subject: [PATCH 1/2] Add more supported datetime timeframes --- dbt2looker/generator.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/dbt2looker/generator.py b/dbt2looker/generator.py index 9b95438..acd9a42 100644 --- a/dbt2looker/generator.py +++ b/dbt2looker/generator.py @@ -185,9 +185,13 @@ 'time', 'date', 'week', + 'day_of_week', 'month', + 'month_name', 'quarter', + 'quarter_of_year', 'year', + 'week_of_year', ] @@ -210,7 +214,7 @@ def lookml_date_time_dimension_group(column: models.DbtModelColumn, adapter_type 'sql': column.meta.dimension.sql or f'${{TABLE}}.{column.name}', 'description': column.meta.dimension.description or column.description, 'datatype': map_adapter_type_to_looker(adapter_type, column.data_type), - 'timeframes': ['raw', 'time', 'hour', 'date', 'week', 'month', 'quarter', 'year'] + 'timeframes': looker_timeframes } From 79f36e9145eba4f88d21ea1662af5637402435af Mon Sep 17 00:00:00 2001 From: FaisalMaqbool Date: Thu, 10 Aug 2023 05:39:06 +0500 Subject: [PATCH 2/2] Update example lkml with supported timeframes --- example/lookml/views/pages.view.lkml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/example/lookml/views/pages.view.lkml b/example/lookml/views/pages.view.lkml index d51e1cb..3bb21f0 100644 --- a/example/lookml/views/pages.view.lkml +++ b/example/lookml/views/pages.view.lkml @@ -9,12 +9,15 @@ view: pages { timeframes: [ raw, time, - hour, date, week, + day_of_week, month, + month_name, quarter, + quarter_of_year, year, + week_of_year, ] }