Skip to main content

databricks.labs.dqx.installer.install

WorkspaceInstaller Objects

class WorkspaceInstaller(WorkspaceContext)

Installer for DQX workspace. Orchestrates install flow (config, version checks, upgrades, dependency wiring).

Arguments:

  • environ - Optional dictionary of environment variables.
  • ws - The WorkspaceClient instance.

upgrades

@cached_property
def upgrades()

Returns the Upgrades instance for the product.

Returns:

An Upgrades instance.

installation

@cached_property
def installation()

Returns the current installation for the product.

Returns:

An Installation instance.

Raises:

  • NotFound - If the installation is not found.

run

def run(default_config: WorkspaceConfig | None = None) -> WorkspaceConfig

Runs the installation process.

Arguments:

  • default_config - Optional default configuration.

Returns:

The final WorkspaceConfig used for the installation.

Raises:

  • ManyError - If multiple errors occur during installation.
  • TimeoutError - If a timeout occurs during installation.

replace_config

def replace_config(**changes: Any) -> WorkspaceConfig | None

Persist the list of workspaces where UCX is successfully installed in the config

configure

def configure(
default_config: WorkspaceConfig | None = None) -> WorkspaceConfig

Configures the workspace.

Notes:

  • Connection errors are not handled within this configure method.

Arguments:

  • default_config - Optional default configuration.

Returns:

The final WorkspaceConfig used for the installation.

Raises:

  • NotFound - If the previous installation is not found.
  • RuntimeWarning - If the existing installation is corrupted.

InstallationService Objects

class InstallationService()

Perform operations on a concrete installation instance (create jobs/dashboards, uninstall, cleanup).

current

@classmethod
def current(cls, ws: WorkspaceClient)

Creates a current WorkspaceInstallation instance based on the current workspace client.

Arguments:

  • ws - The WorkspaceClient instance.

Returns:

A WorkspaceInstallation instance.

config

@property
def config()

Returns the configuration of the workspace installation.

Returns:

The WorkspaceConfig instance.

install_folder

@property
def install_folder()

Returns the installation install_folder path.

Returns:

The installation install_folder path as a string.

run

def run() -> bool

Runs the workflow installation.

Returns:

True if the installation finished successfully, False otherwise.

uninstall

def uninstall()

Uninstalls DQX from the workspace, including project install_folder, dashboards, and jobs.