Skip to content

Commit

Permalink
docs(looker): add API docs for dagster-looker (#21832)
Browse files Browse the repository at this point in the history
## Summary & Motivation
As the title.

## How I Tested These Changes
`make apidoc-build`, `yarn dev`
  • Loading branch information
rexledesma committed May 14, 2024
1 parent 7c2dd53 commit 17987e5
Show file tree
Hide file tree
Showing 12 changed files with 50 additions and 0 deletions.
10 changes: 10 additions & 0 deletions docs/content/_apidocs.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -548,6 +548,16 @@ Dagster also provides a growing set of optional add-on libraries to integrate wi
</td>
<td>Provides components for deploying Dagster to Kubernetes.</td>
</tr>
<tr>
<td>
<a href="/_apidocs/libraries/dagster-looker">Looker</a> (
<code>dagster-looker</code>)
</td>
<td>
Provides an integration to represent a Looker project as a graph of
assets.
</td>
</tr>
<tr>
<td>
<a href="/_apidocs/libraries/dagster-msteams">Microsoft Teams</a> (
Expand Down
4 changes: 4 additions & 0 deletions docs/content/_navigation.json
Original file line number Diff line number Diff line change
Expand Up @@ -1398,6 +1398,10 @@
"title": "Kubernetes (dagster-k8s)",
"path": "/_apidocs/libraries/dagster-k8s"
},
{
"title": "Looker (dagster-looker)",
"path": "/_apidocs/libraries/dagster-looker"
},
{
"title": "MLflow (dagster-mlflow)",
"path": "/_apidocs/libraries/dagster-mlflow"
Expand Down
Binary file modified docs/content/api/modules.json.gz
Binary file not shown.
Binary file modified docs/content/api/searchindex.json.gz
Binary file not shown.
Binary file modified docs/content/api/sections.json.gz
Binary file not shown.
Binary file modified docs/next/public/objects.inv
Binary file not shown.
1 change: 1 addition & 0 deletions docs/sphinx/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
"../../python_modules/libraries/dagster-fivetran",
"../../python_modules/libraries/dagster-github",
"../../python_modules/libraries/dagster-k8s",
"../../python_modules/libraries/dagster-looker",
"../../python_modules/libraries/dagster-managed-elements",
"../../python_modules/libraries/dagster-mlflow",
"../../python_modules/libraries/dagster-msteams",
Expand Down
1 change: 1 addition & 0 deletions docs/sphinx/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@
sections/api/apidocs/libraries/dagster-ge
sections/api/apidocs/libraries/dagster-github
sections/api/apidocs/libraries/dagster-k8s
sections/api/apidocs/libraries/dagster-looker
sections/api/apidocs/libraries/dagster-mlflow
sections/api/apidocs/libraries/dagster-msteams
sections/api/apidocs/libraries/dagster-mysql
Expand Down
15 changes: 15 additions & 0 deletions docs/sphinx/sections/api/apidocs/libraries/dagster-looker.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#######################
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.

.. currentmodule:: dagster_looker


Assets
======

.. autodecorator:: looker_assets
1 change: 1 addition & 0 deletions docs/tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ deps =
-e ../python_modules/libraries/dagster-deltalake-pandas
-e ../python_modules/libraries/dagster-deltalake-polars
-e ../python_modules/libraries/dagster-openai
-e ../python_modules/libraries/dagster-looker

commands =
make --directory=sphinx clean
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
from dagster._core.libraries import DagsterLibraryRegistry

from .asset_decorator import looker_assets as looker_assets
from .version import __version__ as __version__

DagsterLibraryRegistry.register("dagster-looker", __version__)
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import lkml
import yaml
from dagster import AssetKey, AssetsDefinition, AssetSpec, multi_asset
from dagster._annotations import experimental
from sqlglot import exp, parse_one, to_table
from sqlglot.optimizer import Scope, build_scope, optimize

Expand Down Expand Up @@ -111,7 +112,23 @@ def build_looker_view_specs(project_dir: Path) -> Sequence[AssetSpec]:
return looker_view_specs


@experimental
def looker_assets(*, project_dir: Path) -> Callable[[Callable[..., Any]], AssetsDefinition]:
"""A decorator for defining Looker assets in a project.
Args:
project_dir (Path): The path to the Looker project directory.
Examples:
.. code-block:: python
from pathlib import Path
from dagster_looker import looker_assets
@looker_assets(project_dir=Path("my_looker_project"))
def my_looker_project_assets(): ...
"""
lookml_dashboard_specs = [
AssetSpec(
key=AssetKey(["dashboard", lookml_dashboard["dashboard"]]),
Expand Down

0 comments on commit 17987e5

Please sign in to comment.