Use dbt2looker
to generate Looker view files automatically from dbt models.
Features
- Column descriptions synced to looker
- Dimension for each column in dbt model
- Dimension groups for datetime/timestamp/date columns
- Measures defined through dbt column
metadata
see below - Looker types
- Warehouses: BigQuery, Snowflake, Redshift (postgres to come)
Run dbt2looker
in the root of your dbt project after compiling looker docs.
Generate Looker view files for all models:
dbt docs generate
dbt2looker
Generate Looker view files for all models tagged prod
dbt2looker --tag prod
Install from PyPi repository
Install from pypi into a fresh virtual environment.
# Create virtual env
python3.7 -m venv dbt2looker-venv
source dbt2looker-venv/bin/activate
# Install
pip install dbt2looker
# Run
dbt2looker
Build from source
Requires poetry and python >=3.7
# Install
poetry install
# Run
poetry run dbt2looker
You can define looker measures in your dbt schema.yml
files. For example:
models:
- name: pages
columns:
- name: url
description: "Page url"
- name: event_id
description: unique event id for page view
meta:
measures:
page_views:
type: count