Skip to content

Catalog

laktory.models.resources.databricks.Catalog ¤

Bases: TagsMixin, PoliciesMixin, AccessRequestDestinationsMixin, CatalogBase

A catalog is the first layer of Unity Catalog's three-level namespace. It's used to organize your data assets.

Examples:

import io

from laktory import models

catalog_yaml = '''
name: dev
tags:
  environment: dev
data_classification:
  auto_tag_configs:
  - classification_tag: class.email_address
    auto_tagging_mode: AUTO_TAGGING_ENABLED
access_request_destinations:
- destination_type: EMAIL
  destination_id: data-owners@okube.ai
grants:
- principal: account users
  privileges:
  - USE_CATALOG
  - USE_SCHEMA
schemas:
- name: engineering
  grants:
  - principal: domain-engineering
    privileges:
    - SELECT
- name: sources
  volumes:
  - name: landing
    volume_type: EXTERNAL
    grants:
    - principal: account users
      privileges:
      - READ_VOLUME
    - principal: role-metastore-admins
      privileges:
      - WRITE_VOLUME
'''
catalog = models.resources.databricks.Catalog.model_validate_yaml(
    io.StringIO(catalog_yaml)
)
References
BASE DESCRIPTION
browse_only

Indicates whether the principal is limited to retrieving metadata for the associated object through the BROWSE privilege when include_browse is enabled in the request.

TYPE: bool | None | VariableType DEFAULT: None

comment

User-provided free-form text description.

TYPE: str | None | VariableType DEFAULT: None

connection_name

The name of the connection to an external data source.

TYPE: str | None | VariableType DEFAULT: None

custom_max_retention_hours

Custom maximum retention period in hours for the catalog

TYPE: int | None | VariableType DEFAULT: None

effective_predictive_optimization_flag

TYPE: CatalogEffectivePredictiveOptimizationFlag | None | VariableType DEFAULT: None

enable_predictive_optimization

Whether predictive optimization should be enabled for this object and objects under it.

TYPE: str | None | VariableType DEFAULT: None

force_destroy

If True catalog can be deleted, even when not empty

TYPE: bool | VariableType DEFAULT: True

isolation_mode

Whether the catalog is accessible from all workspaces or a specific set of workspaces. Can be ISOLATED or OPEN. Setting the catalog to ISOLATED will automatically allow access from the current workspace.

TYPE: Literal['OPEN', 'ISOLATED'] | VariableType DEFAULT: 'OPEN'

managed_encryption_settings

Control CMK encryption for managed catalog data

TYPE: CatalogManagedEncryptionSettings | None | VariableType DEFAULT: None

metastore_id

Unique identifier of parent metastore.

TYPE: str | None | VariableType DEFAULT: None

name

Name of the catalog

TYPE: str | VariableType

options

A map of key-value properties attached to the securable.

TYPE: dict[str, str] | None | VariableType DEFAULT: None

owner

Username of current owner of catalog.

TYPE: str | None | VariableType DEFAULT: None

properties

A map of key-value properties attached to the securable.

TYPE: dict[str, str] | None | VariableType DEFAULT: None

provider_name

The name of delta sharing provider.

TYPE: str | None | VariableType DEFAULT: None

provisioning_info

TYPE: CatalogProvisioningInfo | None | VariableType DEFAULT: None

share_name

The name of the share under the share provider.

TYPE: str | None | VariableType DEFAULT: None

storage_root

Storage root URL for managed tables within catalog.

TYPE: str | None | VariableType DEFAULT: None

LAKTORY DESCRIPTION
access_request_destinations

Destinations (email, Slack, Microsoft Teams, webhook or the securable owner) notified when users request access to this securable. Deployed as an AccessRequestDestinations resource.

TYPE: list[AccessRequestDestinationsDestinations] DEFAULT: None

data_classification

Data Classification configuration of the catalog: sensitive data is automatically identified and optionally tagged. parent is set automatically.

TYPE: DataClassificationCatalogConfig | VariableType DEFAULT: None

grant

Non-destructive grant for specific principal(s). Adds or updates privileges for the listed principal(s) and leaves grants for all other principals untouched. Use when access is managed from multiple sources (Laktory, Databricks UI, etc.). Mutually exclusive with grants.

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

grants

Authoritative grant list for all principals. Replaces every existing grant on this Catalog - including those set outside Laktory - with only the entries listed here. Use only when Laktory owns all access management for this resource. Mutually exclusive with grant.

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

policies

Attribute-based access control (ABAC) policies defined on this securable. on_securable_type and on_securable_fullname are set automatically.

TYPE: list[PolicyInfo] DEFAULT: None

schemas

List of schemas stored in the catalog

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

tags

Tags assigned to the entity as {tag_key: tag_value}. Use a null value for a key-only tag. Each tag is deployed as a separate tag assignment resource.

TYPE: dict[str, str | None] DEFAULT: None

workspace_bindings

If you use workspaces to isolate user data access, you may want to limit access from specific workspaces in your account, also known as workspace binding.

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

METHOD DESCRIPTION
get_tags_additional_resources

Tag assignment resources for entity (a name or a resource reference).

ATTRIBUTE DESCRIPTION
additional_core_resources
  • catalog grants

TYPE: list

full_name

Full name of the catalog {catalog_name}

TYPE: str

additional_core_resources property ¤

  • catalog grants
  • catalog tags
  • catalog policies
  • catalog data classification
  • catalog access request destinations
  • schemas resources

full_name property ¤

Full name of the catalog {catalog_name}

get_tags_additional_resources(entity_type, entity, tags=None) ¤

Tag assignment resources for entity (a name or a resource reference). Defaults to the tags of this resource.

Source code in laktory/models/resources/databricks/_tagsmixin.py
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
def get_tags_additional_resources(
    self, entity_type: str, entity: str, tags: dict[str, str | None] | None = None
) -> list:
    """
    Tag assignment resources for `entity` (a name or a resource reference).
    Defaults to the `tags` of this resource.
    """
    if tags is None:
        tags = self.tags
    resources = []
    for key, value in (tags or {}).items():
        if entity_type in WORKSPACE_ENTITY_TYPES:
            r = WorkspaceEntityTagAssignment(
                entity_type=entity_type,
                entity_id=entity,
                tag_key=key,
                tag_value=value,
            )
        else:
            r = EntityTagAssignment(
                entity_type=entity_type,
                entity_name=entity,
                tag_key=key,
                tag_value=value,
            )
        resources += [r]
    return resources

laktory.models.resources.databricks.catalog.CatalogEffectivePredictiveOptimizationFlag ¤

Bases: BaseModel

PARAMETER DESCRIPTION
inherited_from_name

TYPE: str | None | VariableType DEFAULT: None

inherited_from_type

TYPE: str | None | VariableType DEFAULT: None

value

TYPE: str | VariableType


laktory.models.resources.databricks.catalog.CatalogLookup ¤

Bases: ResourceLookup

PARAMETER DESCRIPTION
name

Catalog name

TYPE: str | VariableType


laktory.models.resources.databricks.catalog.CatalogManagedEncryptionSettings ¤

Bases: BaseModel

PARAMETER DESCRIPTION
azure_encryption_settings

TYPE: CatalogManagedEncryptionSettingsAzureEncryptionSettings | None | VariableType DEFAULT: None

azure_key_vault_key_id

TYPE: str | None | VariableType DEFAULT: None

customer_managed_key_id

TYPE: str | None | VariableType DEFAULT: None


laktory.models.resources.databricks.catalog.CatalogManagedEncryptionSettingsAzureEncryptionSettings ¤

Bases: BaseModel

PARAMETER DESCRIPTION
azure_cmk_access_connector_id

TYPE: str | None | VariableType DEFAULT: None

azure_cmk_managed_identity_id

TYPE: str | None | VariableType DEFAULT: None

azure_tenant_id

TYPE: str | VariableType


laktory.models.resources.databricks.catalog.CatalogProvisioningInfo ¤

Bases: BaseModel

PARAMETER DESCRIPTION
state

TYPE: str | None | VariableType DEFAULT: None