Ask AI

Looker (dagster-looker)

Dagster allows you to represent your Looker project 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 project.

Assets

dagster_looker.build_looker_asset_specs(*, project_dir, dagster_looker_translator=None)[source]

experimental This API may break in future versions, even between dot releases.

Build a list of asset specs from a set of Looker structures defined in a Looker project.

Parameters:
  • project_dir (Path) – The path to the Looker project directory.

  • dagster_looker_translator (Optional[DagsterLookerTranslator]) – Allows customizing how to map looker structures to asset keys and asset metadata.

Examples

from pathlib import Path

from dagster import external_assets_from_specs
from dagster_looker import build_looker_asset_specs


looker_specs = build_looker_asset_specs(project_dir=Path("my_looker_project"))
looker_assets = external_assets_from_specs(looker_specs)
class dagster_looker.DagsterLookerTranslator(*args, **kwargs)[source]

experimental This API may break in future versions, even between dot releases.

Holds a set of methods that derive Dagster asset definition metadata given a representation of a LookML structure (dashboards, explores, views).

This class is exposed so that methods can be overriden to customize how Dagster asset metadata is derived.

get_asset_key(lookml_structure)[source]

A method that takes in a LookML structure (dashboards, explores, views) and returns the Dagster asset key that represents the structure.

The LookML structure is parsed using lkml. You can learn more about this here: https://lkml.readthedocs.io/en/latest/simple.html.

You can learn more about LookML dashboards and the properties available in this dictionary here: https://cloud.google.com/looker/docs/reference/param-lookml-dashboard.

You can learn more about LookML explores and views and the properties available in this dictionary here: https://cloud.google.com/looker/docs/reference/lookml-quick-reference.

This method can be overriden to provide a custom asset key for a LookML structure.

Parameters:

lookml_structure (Tuple[Path, str, Mapping[str, Any]]) – A tuple with the path to file defining a LookML structure, the LookML structure type, and a dictionary representing a LookML structure.

Returns:

The Dagster asset key that represents the LookML structure.

Return type:

AssetKey

get_deps(lookml_structure)[source]

A method that takes in a LookML structure (dashboards, explores, views) and returns the Dagster dependencies of that the structure.

The LookML structure is parsed using lkml. You can learn more about this here: https://lkml.readthedocs.io/en/latest/simple.html.

You can learn more about LookML dashboards and the properties available in this dictionary here: https://cloud.google.com/looker/docs/reference/param-lookml-dashboard.

You can learn more about LookML explores and views and the properties available in this dictionary here: https://cloud.google.com/looker/docs/reference/lookml-quick-reference.

This method can be overriden to provide custom dependencies for a LookML structure.

Parameters:

lookml_structure (Tuple[Path, str, Mapping[str, Any]]) – A tuple with the path to file defining a LookML structure, the LookML structure type, and a dictionary representing a LookML structure.

Returns:

The Dagster dependencies for the LookML structure.

Return type:

AssetKey

get_description(lookml_structure)[source]

A method that takes in a LookML structure (dashboards, explores, views) and returns the Dagster description of the structure.

The LookML structure is parsed using lkml. You can learn more about this here: https://lkml.readthedocs.io/en/latest/simple.html.

You can learn more about LookML dashboards and the properties available in this dictionary here: https://cloud.google.com/looker/docs/reference/param-lookml-dashboard.

You can learn more about LookML explores and views and the properties available in this dictionary here: https://cloud.google.com/looker/docs/reference/lookml-quick-reference.

This method can be overriden to provide a custom description for a LookML structure.

Parameters:

lookml_structure (Tuple[Path, str, Mapping[str, Any]]) – A tuple with the path to file defining a LookML structure, the LookML structure type, and a dictionary representing a LookML structure.

Returns:

The Dagster description for the LookML structure.

Return type:

Optional[str]

get_group_name(lookml_structure)[source]

A method that takes in a LookML structure (dashboards, explores, views) and returns the Dagster group name of the structure.

The LookML structure is parsed using lkml. You can learn more about this here: https://lkml.readthedocs.io/en/latest/simple.html.

You can learn more about LookML dashboards and the properties available in this dictionary here: https://cloud.google.com/looker/docs/reference/param-lookml-dashboard.

You can learn more about LookML explores and views and the properties available in this dictionary here: https://cloud.google.com/looker/docs/reference/lookml-quick-reference.

This method can be overriden to provide a custom group name for a LookML structure.

Parameters:

lookml_structure (Tuple[Path, str, Mapping[str, Any]]) – A tuple with the path to file defining a LookML structure, the LookML structure type, and a dictionary representing a LookML structure.

Returns:

A Dagster group name for the LookML structure.

Return type:

Optional[str]

get_metadata(lookml_structure)[source]

A method that takes in a LookML structure (dashboards, explores, views) and returns the Dagster metadata of the structure.

The LookML structure is parsed using lkml. You can learn more about this here: https://lkml.readthedocs.io/en/latest/simple.html.

You can learn more about LookML dashboards and the properties available in this dictionary here: https://cloud.google.com/looker/docs/reference/param-lookml-dashboard.

You can learn more about LookML explores and views and the properties available in this dictionary here: https://cloud.google.com/looker/docs/reference/lookml-quick-reference.

This method can be overriden to provide custom metadata for a LookML structure.

Parameters:

lookml_structure (Tuple[Path, str, Mapping[str, Any]]) – A tuple with the path to file defining a LookML structure, the LookML structure type, and a dictionary representing a LookML structure.

Returns:

A dictionary representing the Dagster metadata for the

LookML structure.

Return type:

Optional[Mapping[str, Any]]

get_owners(lookml_structure)[source]

A method that takes in a LookML structure (dashboards, explores, views) and returns the Dagster owners of the structure.

The LookML structure is parsed using lkml. You can learn more about this here: https://lkml.readthedocs.io/en/latest/simple.html.

You can learn more about LookML dashboards and the properties available in this dictionary here: https://cloud.google.com/looker/docs/reference/param-lookml-dashboard.

You can learn more about LookML explores and views and the properties available in this dictionary here: https://cloud.google.com/looker/docs/reference/lookml-quick-reference.

This method can be overriden to provide custom owners for a LookML structure.

Parameters:

lookml_structure (Tuple[Path, str, Mapping[str, Any]]) – A tuple with the path to file defining a LookML structure, the LookML structure type, and a dictionary representing a LookML structure.

Returns:

A sequence of Dagster owners for the LookML structure.

Return type:

Optional[Sequence[str]]

get_tags(lookml_structure)[source]

A method that takes in a LookML structure (dashboards, explores, views) and returns the Dagster tags of the structure.

The LookML structure is parsed using lkml. You can learn more about this here: https://lkml.readthedocs.io/en/latest/simple.html.

You can learn more about LookML dashboards and the properties available in this dictionary here: https://cloud.google.com/looker/docs/reference/param-lookml-dashboard.

You can learn more about LookML explores and views and the properties available in this dictionary here: https://cloud.google.com/looker/docs/reference/lookml-quick-reference.

This method can be overriden to provide custom tags for a LookML structure.

Parameters:

lookml_structure (Tuple[Path, str, Mapping[str, Any]]) – A tuple with the path to file defining a LookML structure, the LookML structure type, and a dictionary representing a LookML structure.

Returns:

A dictionary representing the Dagster tags for the

LookML structure.

Return type:

Optional[Mapping[str, str]]