Dagster & Looker (Component)
This feature is considered in a beta stage. It is still being tested and may change. For more information, see the API lifecycle stages documentation.
The dagster-looker library provides a LookerComponent which can be used to easily represent Looker dashboards, explores, and Persistent Derived Tables (PDTs) as assets in Dagster.
LookerComponent is a state-backed component, which fetches and caches Looker instance metadata. For information on managing component state, see Configuring state-backed components.
1. Prepare a Dagster project
To begin, you'll need a Dagster project. You can use an existing components-ready project or create a new one:
uvx create-dagster project my-project && cd my-project/src
Activate the project virtual environment:
source ../.venv/bin/activate
Finally, add the dagster-looker library to the project:
uv add dagster-looker
2. Scaffold a Looker component definition
Now that you have a Dagster project, you can scaffold a Looker component definition:
dg scaffold defs dagster_looker.LookerComponent looker_ingest
Creating defs at /.../my-project/src/my_project/defs/looker_ingest.
The dg scaffold defs call will generate a defs.yaml file:
tree my_project/defs
my_project/defs
├── __init__.py
└── looker_ingest
└── defs.yaml
2 directories, 2 files
3. Configure your Looker instance
Update the defs.yaml file with your Looker instance connection details. You'll need to provide your base URL, client ID, and client secret. For more information on creating API credentials, see the Looker API documentation.
type: dagster_looker.LookerComponent
attributes:
looker_resource:
base_url: "{{ env.LOOKER_BASE_URL }}"
client_id: "{{ env.LOOKER_CLIENT_ID }}"
client_secret: "{{ env.LOOKER_CLIENT_SECRET }}"
dg list defs
┏━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
┃ Section ┃ Definitions ┃