Dagster Integration:
Using Dagster with Looker
About this integration
Dagster allows you to represent your Looker instance as assets, alongside other your other technologies like dbt and Sling. This allows you to see how your Looker assets are connected to your other data assets, and how changes to other data assets might impact your Looker instance. This also enables you to orchestrate the building of your persistent derived tables (PDTs), ensuring your Looker instance reflects the most current data from upstream sources.
Installation
pip install dagster-looker
Example
from dagster_looker import (
LookerResource,
RequestStartPdtBuild,
build_looker_pdt_assets_definitions,
load_looker_asset_specs,
)
import dagster as dg
looker_resource = LookerResource(
client_id=dg.EnvVar("LOOKERSDK_CLIENT_ID"),
client_secret=dg.EnvVar("LOOKERSDK_CLIENT_SECRET"),
base_url=dg.EnvVar("LOOKERSDK_HOST_URL"),
)
looker_specs = load_looker_asset_specs(looker_resource=looker_resource)
pdts = build_looker_pdt_assets_definitions(
resource_key="looker",
request_start_pdt_builds=[
RequestStartPdtBuild(model_name="my_model", view_name="my_view")
],
)
defs = dg.Definitions(
assets=[*pdts, *looker_specs],
resources={"looker": looker_resource},
)
About Looker
Looker is a modern platform for data analytics and visualization. It provides a unified interface for data exploration, modeling, and visualization, making it easier to understand and analyze data. Looker integrates with various data sources and can be used to create interactive reports, dashboards, and visualizations.