catalog_workspace.

clone_workspace

clone_workspace(source_workspace_id: str, target_workspace_id: Optional[str] = None, target_workspace_name: Optional[str] = None, overwrite_existing: Optional[bool] = None, data_source_mapping: Optional[dict] = None, upper_case: Optional[bool] = True )

Clone workspace from existing workspace.

Clones complete workspace content - LDM, ADM, permissions. If the target workspace already exists, it’s content is overwritten.

This can be useful when testing changes in the clone - once you are satisfied, you can clone it back to the origin workspace.

For the safety, you have to enforce this behavior by the dedicated input argument overwrite_existing. Beware of workspace data filters - after the clone you have to set WDF value for the new workspace.

Parameters

nametypedescription
source_workspace_idstringSource workspace ID, from which we wanna create a clone
target_workspace_idOptional[string]Target workspace ID, where we wanna clone the source workspaceOptional, if empty, we generate _clone
target_workspace_nameOptional[string]Target workspace name, if empty, we generate (Clone)
overwrite_existingboolOverwrite existing workspace.
data_source_mappingOptional[dict]Optional, allows users to map LDM to different data source ID
upper_caseOptional[bool]Optional, allows users to change the case of all physical object IDs (table names, columns names)

True changes it to upper-case, False to lower-case, None(default) is noop

Useful when migrating to Snowflake, which is the only DB with upper-case default.

Returns

None

Example

# Clones complete workspace content - LDM, ADM, permissions.
sdk.catalog_workspace.clone_workspace(
        source_workspace_id="123",
        target_workspace_id="xyz",
        target_workspace_name="Demo"
)