Skip to content

Notebook

laktory.models.resources.databricks.Notebook ¤

Bases: NotebookBase

Databricks Notebook

Examples:

import io

from laktory import models

notebook_yaml = '''
source: ./notebooks/dlt/dlt_laktory_pl.py
dirpath: notebooks/dlt/
access_controls:
- group_name: role-engineers
  permission_level: CAN_RUN
'''
notebook = models.resources.databricks.Notebook.model_validate_yaml(
    io.StringIO(notebook_yaml)
)
print(notebook.path)
# > /.laktory/notebooks/dlt/dlt_laktory_pl.py
References
BASE DESCRIPTION
content_base64

The base64-encoded notebook source code. Conflicts with source. Use of content_base64 is discouraged, as it's increasing memory footprint of Terraform state and should only be used in exceptional circumstances, like creating a notebook with configuration properties for a data pipeline

TYPE: str | None | VariableType DEFAULT: None

format

TYPE: str | None | VariableType DEFAULT: None

language

(required with content_base64) One of SCALA, PYTHON, SQL, R

TYPE: str | None | VariableType DEFAULT: None

md5

TYPE: str | None | VariableType DEFAULT: None

object_id

Unique identifier for a NOTEBOOK

TYPE: int | None | VariableType DEFAULT: None

object_type

TYPE: str | None | VariableType DEFAULT: None

source

Path to notebook in source code format on local filesystem. Conflicts with content_base64

TYPE: str | None | VariableType DEFAULT: None

LAKTORY DESCRIPTION
access_controls

List of notebook access controls

TYPE: list[AccessControl | VariableType] | VariableType DEFAULT: []

dirpath

Workspace directory inside rootpath in which the notebook is deployed. Used only if path is not specified.

TYPE: str | VariableType DEFAULT: None

path_

Workspace filepath for the notebook. Overwrite rootpath and dirpath.

TYPE: str | VariableType DEFAULT: None

ATTRIBUTE DESCRIPTION
additional_core_resources
  • permissions

TYPE: list

filename

Notebook file name

TYPE: str

additional_core_resources property ¤

  • permissions

filename property ¤

Notebook file name


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

Bases: ResourceLookup

PARAMETER DESCRIPTION
format

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

TYPE: str | VariableType DEFAULT: 'SOURCE'

path

Notebook path on the workspace

TYPE: str | VariableType