yggdrasil.databricks.column¶
column ¶
Unity Catalog column resource + service.
Column ¶
entity_name
property
¶
Fully-qualified entity_name for the entity_tag_assignments API.
set_tags ¶
Apply column-level tags via the UC entity_tag_assignments API.
tag_collation is accepted for API compatibility and ignored —
collations only matter for the legacy DDL literal form.
unset_tags ¶
Delete column-level tag assignments by key.
rename ¶
Rename this column in-place (ALTER TABLE … RENAME COLUMN …).
Columns ¶
Columns(
client=None,
catalog_name: str | None = None,
schema_name: str | None = None,
table_name: str | None = None,
column_name: str | None = None,
)
Bases: DatabricksService
Collection-level service for Unity Catalog columns.
Carry default catalog / schema / table / column context so callers do not have to repeat them on every call::
cols = client.columns(catalog_name="main", schema_name="sales", table_name="orders")
col = cols.column("price")
for c in cols.list_columns():
print(c.name)
environments
property
¶
Base-environment service (shorthand for client.environments).
tables
property
¶
Collection-level Unity Catalog table service (shorthand for client.tables).
views
property
¶
Alias for :attr:tables — :class:Table covers both managed/external
tables and view-shaped securables.
catalogs
property
¶
Collection-level Unity Catalog hierarchy service (shorthand for client.catalogs).
schemas
property
¶
Collection-level Unity Catalog schema service (shorthand for client.schemas).
volumes
property
¶
Collection-level Unity Catalog volume service (shorthand for client.volumes).
default_tags ¶
Return default resource tags for Databricks assets.
Returns:
| Type | Description |
|---|---|
dict[str, str]
|
A dict of default tags. |
parse_location ¶
parse_location(
location: str,
) -> tuple[Optional[str], Optional[str], Optional[str], Optional[str]]
Parse a dotted location into (catalog, schema, table, column).
Supported forms (backtick-quoted parts are stripped):
========================================== =============================================
Input Result
========================================== =============================================
"price" (self.catalog, self.schema, self.table, "price")
"orders.price" (self.catalog, self.schema, "orders", "price")
"sales.orders.price" (self.catalog, "sales", "orders", "price")
"main.sales.orders.price" ("main", "sales", "orders", "price")
========================================== =============================================
Excess leading parts are dropped — only the rightmost four are used.
column ¶
column(
location: str | None = None,
*,
catalog_name: str | None = None,
schema_name: str | None = None,
table_name: str | None = None,
column_name: str | None = None
) -> "Column"
Resolve and return a single :class:~yggdrasil.databricks.column.column.Column.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
location
|
str | None
|
Dotted name ( |
None
|
catalog_name
|
str | None
|
Override catalog (falls back to service default). |
None
|
schema_name
|
str | None
|
Override schema (falls back to service default). |
None
|
table_name
|
str | None
|
Override table (falls back to service default). |
None
|
column_name
|
str | None
|
Override column name (falls back to last location part). |
None
|
Returns:
| Type | Description |
|---|---|
'Column'
|
The resolved :class: |
Raises:
| Type | Description |
|---|---|
AssertionError
|
When any of catalog / schema / table is missing. |
ValueError
|
When the column does not exist in the table. |
list_columns ¶
list_columns(
location: str | None = None,
*,
catalog_name: str | None = None,
schema_name: str | None = None,
table_name: str | None = None
) -> list["Column"]
Return all columns for a table.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
location
|
str | None
|
Dotted name (table or schema.table or fully qualified). |
None
|
catalog_name
|
str | None
|
Override catalog. |
None
|
schema_name
|
str | None
|
Override schema. |
None
|
table_name
|
str | None
|
Override table. |
None
|
Returns:
| Type | Description |
|---|---|
list['Column']
|
List of :class: |