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 inside rootpath in which the notebook is deployed. Used only 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. Overwrite rootpath and dirpath.

TYPE: str

rootpath

Root directory to which all notebooks are deployed to. Can also be configured by settings LAKTORY_WORKSPACE_LAKTORY_ROOT environment variable. Default is /.laktory/. Used only if path is not specified.

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_laktory_pl.py

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

notebook = models.resources.databricks.Notebook(
    source="./notebooks/dlt/dlt_laktory_pl.py",
    rootpath="/src/",
    dirpath="notebooks/dlt/",
)
print(notebook.path)
# > /src/notebooks/dlt/dlt_laktory_pl.py
ATTRIBUTE DESCRIPTION
filename

Notebook file name

TYPE: str

resource_key

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

TYPE: str

additional_core_resources
  • permissions

TYPE: list[PulumiResource]

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