Skip to content

yggdrasil.databricks.warehouse.wh_utils

wh_utils

next_indexed_name

next_indexed_name(name: str) -> str

Return name with its trailing [int] suffix incremented.

"wh" -> "wh [2]" "wh [2]" -> "wh [3]" "wh [10]" -> "wh [11]" "wh [2] " -> "wh [3]" (whitespace tolerated) "" -> " [2]" (degenerate; caller should guard)

indexed_name_parts

indexed_name_parts(name: str) -> tuple[str, int]

Split name into (base, index).

Unsuffixed names return index 1 (the implicit "first" warehouse).

"wh" -> ("wh", 1) "wh [2]" -> ("wh", 2) "wh [10]" -> ("wh", 10)

name_at_index

name_at_index(name: str, index: int) -> str

Return name rewritten with [index] suffix (or no suffix if index==1).

serverless_sibling_spec

serverless_sibling_spec(
    details: EndpointInfo, *, name: Optional[str] = None
) -> dict

Build a create_warehouse kwargs dict for a serverless sibling.

Clones the editable subset of details (filtered through :data:_EDIT_ARG_NAMES), forces enable_serverless_compute=True for fast cold-start, and assigns name — defaulting to the next [idx]-suffixed sibling of details.name.