Skip to content

yggdrasil.databricks.securable

securable

Dict-like base for Unity Catalog securable collection services.

:class:SecurableMapping makes a :class:DatabricksService over a named securable collection (credentials, external locations, …) a :class:~collections.abc.MutableMapping::

svc[name]                 # fetch the resource (KeyError if absent)
svc[name] = spec          # create it (or update if it exists)
del svc[name]             # delete it
name in svc               # exists?
list(svc) / len(svc)      # the securable names
svc.get(name) / svc.pop(name) / svc.keys() / .values() / .items()

So the full mapping mixin (get / pop / keys / values / items / setdefault / …) comes for free. clear() is refused — a bulk wipe of a metastore collection is never what you meant.

A subclass implements six hooks: :meth:resolve (flexible coercion → a lazy handle), :meth:_infos (SDK info iterator), :meth:get_info, :meth:_resource (handle factory), :meth:delete, and :meth:_apply (create-or-update).

SecurableMapping

SecurableMapping(client: Optional[DatabricksClient] = None)

Bases: DatabricksService, MutableMapping

wheels property

wheels: 'Wheels'

Wheel registry service (shorthand for client.wheels).

environments property

environments: 'Environments'

Base-environment service (shorthand for client.environments).

tables property

tables: 'Tables'

Collection-level Unity Catalog table service (shorthand for client.tables).

views property

views: 'Tables'

Alias for :attr:tables — :class:Table covers both managed/external tables and view-shaped securables.

catalogs property

catalogs: 'Catalogs'

Collection-level Unity Catalog hierarchy service (shorthand for client.catalogs).

schemas property

schemas: 'Schemas'

Collection-level Unity Catalog schema service (shorthand for client.schemas).

volumes property

volumes: 'Volumes'

Collection-level Unity Catalog volume service (shorthand for client.volumes).

genie property

genie: 'Genie'

Genie service (shorthand for client.genie).

ai property

ai: 'DatabricksAI'

Databricks AI umbrella service (shorthand for client.ai).

resolve abstractmethod

resolve(obj: Any = None, **kwargs: Any) -> Any

Coerce (resource | name | id | kwargs) to a lazy resource handle (no fetch for the plain-name case).

get_info abstractmethod

get_info(name: str) -> Any

Fetch one securable's SDK info (raises :class:NotFound).

list

list() -> Iterator[Any]

Iterate every securable as a resource handle (info pre-seeded).

default_tags

default_tags(update: bool = True) -> dict[str, str]

Return default resource tags for Databricks assets.

Returns:

Type Description
dict[str, str]

A dict of default tags.