Skip to content

Notebook

laktory.models.resources.databricks.Notebook ¤

Bases: BaseModel, PulumiResource, TerraformResource

Databricks Notebook

ATTRIBUTE DESCRIPTION
access_controls

List of notebook access controls

TYPE: list[AccessControl]

dirpath

Workspace directory containing the notebook. Filename will be assumed to be the same as local filepath. Used if path is not specified.

TYPE: str

language

Notebook programming language

TYPE: Literal['SCALA', 'PYTHON', 'SQL', 'R']

lookup_existing

Specifications for looking up existing resource. Other attributes will be ignored.

TYPE: NotebookLookup

path

Workspace filepath for the notebook

TYPE: str

source

Path to notebook in source code format on local filesystem.

TYPE: str

Examples:

from laktory import models

notebook = models.resources.databricks.Notebook(
    source="./notebooks/dlt/dlt_laktory_pl.py",
)
print(notebook.path)
#> /.laktory/dlt/dlt_laktory_pl.py

notebook = models.resources.databricks.Notebook(
    source="./notebooks/create_view.py", dirpath="/views/"
)
print(notebook.path)
#> /views/create_view.py

Attributes¤

filename property ¤

filename

Notebook file name

resource_key property ¤

resource_key

path with special characters /, ., \ replaced with -

additional_core_resources property ¤

additional_core_resources
  • permissions

--

laktory.models.resources.databricks.notebook.NotebookLookup ¤

Bases: ResourceLookup

ATTRIBUTE DESCRIPTION
path

Notebook path on the workspace

TYPE: str

format

Notebook format to export. Either SOURCE, HTML, JUPYTER, or DBC

TYPE: str