Skip to content

Library

laktory.models.resources.databricks.Library ¤

Bases: LibraryBase

Databricks library

Examples:

import io

from laktory import models

library_yaml = '''
cluster_id: cluster-id
pypi:
  - package: pandas
'''
library = models.resources.databricks.Library.model_validate_yaml(
    io.StringIO(library_yaml)
)
References
BASE DESCRIPTION
cluster_id

ID of the databricks_cluster to install the library on

TYPE: str | VariableType

cran

Configuration block for a CRAN library. The block consists of the following fields:

TYPE: list[LibraryCran] | None | VariableType DEFAULT: None

egg

Path to the EGG library. Installing Python egg files is deprecated and is not supported in Databricks Runtime 14.0 and above. Use whl or pypi instead

TYPE: str | None | VariableType DEFAULT: None

jar

Path to the JAR library. Supported URIs include Workspace paths, Unity Catalog Volumes paths, and S3 URIs. For example: /Workspace/path/to/library.jar, /Volumes/path/to/library.jar or s3://my-bucket/library.jar. If S3 is used, make sure the cluster has read access to the library. You may need to launch the cluster with an IAM role to access the S3 URI

TYPE: str | None | VariableType DEFAULT: None

maven

Configuration block for a Maven library. The block consists of the following fields:

TYPE: list[LibraryMaven] | None | VariableType DEFAULT: None

pypi

Configuration block for a PyPI library. The block consists of the following fields:

TYPE: list[LibraryPypi] | None | VariableType DEFAULT: None

requirements

Path to the requirements.txt file. Only Workspace paths and Unity Catalog Volumes paths are supported. For example: /Workspace/path/to/requirements.txt or /Volumes/path/to/requirements.txt. Requires a cluster with DBR 15.0+

TYPE: str | None | VariableType DEFAULT: None

whl

Path to the wheel library. Supported URIs include Workspace paths, Unity Catalog Volumes paths, and S3 URIs. For example: /Workspace/path/to/library.whl, /Volumes/path/to/library.whl or s3://my-bucket/library.whl. If S3 is used, make sure the cluster has read access to the library. You may need to launch the cluster with an IAM role to access the S3 URI

TYPE: str | None | VariableType DEFAULT: None


laktory.models.resources.databricks.library.LibraryCran ¤

Bases: BaseModel

PARAMETER DESCRIPTION
package

The name of the CRAN package to install

TYPE: str | VariableType

repo

The repository where the package can be found. If not specified, the default CRAN repo is used

TYPE: str | None | VariableType DEFAULT: None


laktory.models.resources.databricks.library.LibraryMaven ¤

Bases: BaseModel

PARAMETER DESCRIPTION
coordinates

Gradle-style Maven coordinates. For example: org.jsoup:jsoup:1.7.2

TYPE: str | VariableType

exclusions

List of dependencies to exclude. For example: ['slf4j:slf4j', '*:hadoop-client']. See Maven dependency exclusions for more information

TYPE: list[str] | None | VariableType DEFAULT: None

repo

The repository where the package can be found. If not specified, the default CRAN repo is used

TYPE: str | None | VariableType DEFAULT: None


laktory.models.resources.databricks.library.LibraryPypi ¤

Bases: BaseModel

PARAMETER DESCRIPTION
package

The name of the CRAN package to install

TYPE: str | VariableType

repo

The repository where the package can be found. If not specified, the default CRAN repo is used

TYPE: str | None | VariableType DEFAULT: None