From 0f5276882c4c57c9d3052255964e02dee396f9ef Mon Sep 17 00:00:00 2001 From: oliverlaslett Date: Sat, 17 Apr 2021 23:58:00 +0100 Subject: [PATCH] add measure descriptions --- dbt2looker/generator.py | 1 + example/lookml/views/pages.view | 1 + pyproject.toml | 2 +- 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/dbt2looker/generator.py b/dbt2looker/generator.py index 33b9778..7f92f69 100644 --- a/dbt2looker/generator.py +++ b/dbt2looker/generator.py @@ -170,6 +170,7 @@ def lookml_measures_from_model(model: models.DbtModel): 'name': measure.name, 'type': measure.type.value, 'sql': f'${{TABLE}}.{column.name}', + 'description': f'{measure.type.value.capitalize()} of {column.description}', } for column in model.columns.values() for measure in column.meta.looker.measures diff --git a/example/lookml/views/pages.view b/example/lookml/views/pages.view index ba757c5..a0f5ed5 100644 --- a/example/lookml/views/pages.view +++ b/example/lookml/views/pages.view @@ -54,5 +54,6 @@ view: pages { measure: Page views { type: count sql: ${TABLE}.id ;; + description: "Count of The primary key for this table" } } \ No newline at end of file diff --git a/pyproject.toml b/pyproject.toml index 0aea889..f3061d4 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "dbt2looker" -version = "0.6.0" +version = "0.6.1" description = "Generate lookml view files from dbt models" authors = ["oliverlaslett "] license = "MIT"