Skip to content

Share

laktory.models.resources.databricks.Share ¤

Bases: ShareBase

Databricks Share for Delta Sharing

A share is a container that holds the objects to be shared with recipients. Shares enable data sharing between Databricks workspaces.

Examples:

import io

from laktory import models

share_yaml = '''
name: finance-share
comment: Share for the finance domain data
objects:
- name: dev.finance.slv_stock_prices
  data_object_type: TABLE
  comment: Silver stock prices table
'''
share = models.resources.databricks.Share.model_validate_yaml(
    io.StringIO(share_yaml)
)
References
BASE DESCRIPTION
comment

Description about the object

TYPE: str | None | VariableType DEFAULT: None

name

The name of the partition column

TYPE: str | VariableType

object

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

owner

User name/group name/sp application_id of the share owner

TYPE: str | None | VariableType DEFAULT: None

storage_root

TYPE: str | None | VariableType DEFAULT: None

LAKTORY DESCRIPTION
provider_config

Provider config

TYPE: ShareProviderConfig | VariableType DEFAULT: None


laktory.models.resources.databricks.share.ShareObject ¤

Bases: BaseModel

PARAMETER DESCRIPTION
cdf_enabled

Whether to enable Change Data Feed (cdf) on the shared object. When this field is set, field history_data_sharing_status can not be set

TYPE: bool | None | VariableType DEFAULT: None

comment

Description about the object

TYPE: str | None | VariableType DEFAULT: None

content

The content of the notebook file when the data object type is NOTEBOOK_FILE. This should be base64 encoded. Required for adding a NOTEBOOK_FILE, optional for updating, ignored for other types

TYPE: str | None | VariableType DEFAULT: None

data_object_type

Type of the data object. Supported types: TABLE, FOREIGN_TABLE, SCHEMA, VIEW, MATERIALIZED_VIEW, STREAMING_TABLE, MODEL, NOTEBOOK_FILE, FUNCTION, FEATURE_SPEC, and VOLUME

TYPE: str | VariableType

history_data_sharing_status

Whether to enable history sharing, one of: ENABLED, DISABLED. When a table has history sharing enabled, recipients can query table data by version, starting from the current table version. If not specified, clients can only query starting from the version of the object at the time it was added to the share. NOTE: The start_version should be less than or equal the current version of the object. When this field is set, field cdf_enabled can not be set

TYPE: str | None | VariableType DEFAULT: None

name

The name of the partition column

TYPE: str | VariableType

partition

Array of partitions for the shared data

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

shared_as

A user-provided alias name for table-like data objects within the share. Use this field for: TABLE, VIEW, MATERIALIZED_VIEW, STREAMING_TABLE, FOREIGN_TABLE. Do not use this field for volumes, models, notebooks, or functions (use string_shared_as instead). If not provided, the object's original name will be used. Must be a 2-part name <schema>.<table> containing only alphanumeric characters and underscores. The shared_as name must be unique within a share. Change forces creation of a new resource

TYPE: str | None | VariableType DEFAULT: None

start_version

The start version associated with the object for cdf. This allows data providers to control the lowest object version that is accessible by clients

TYPE: int | None | VariableType DEFAULT: None

string_shared_as

A user-provided alias name for non-table data objects within the share. Use this field for: VOLUME, MODEL, NOTEBOOK_FILE, FUNCTION. Do not use this field for tables, views, or streaming tables (use shared_as instead). Format varies by type: For volumes, models, and functions use <schema>.<name> (2-part name); for notebooks use the file name. Names must contain only alphanumeric characters and underscores. The string_shared_as name must be unique for objects of the same type within a share. Change forces creation of a new resource

TYPE: str | None | VariableType DEFAULT: None


laktory.models.resources.databricks.share.ShareObjectPartition ¤

Bases: BaseModel

PARAMETER DESCRIPTION
value

The value of the partition column. When this value is not set, it means null value. When this field is set, field recipient_property_key can not be set

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


laktory.models.resources.databricks.share.ShareObjectPartitionValue ¤

Bases: BaseModel

PARAMETER DESCRIPTION
name

The name of the partition column

TYPE: str | VariableType

op

The operator to apply for the value, one of: EQUAL, LIKE

TYPE: str | VariableType

recipient_property_key

The key of a Delta Sharing recipient's property. For example databricks-account-id. When this field is set, field value can not be set

TYPE: str | None | VariableType DEFAULT: None

value

The value of the partition column. When this value is not set, it means null value. When this field is set, field recipient_property_key can not be set

TYPE: str | None | VariableType DEFAULT: None


laktory.models.resources.databricks.share.ShareProviderConfig ¤

Bases: BaseModel

Provider Config

PARAMETER DESCRIPTION
workspace_id

Workspace ID which the resource belongs to. This workspace must be part of the account which the provider is configured with.

TYPE: str | VariableType