sempy_labs.warehouse package
Module contents
- sempy_labs.warehouse.create_restore_point(warehouse: str | UUID, name: str, description: str | None = None, workspace: str | UUID | None = None)
Creates a restore point in a warehouse.
This is a wrapper function for the following API: Restore Points - Create Restore Point.
- Parameters:
warehouse (str | uuid.UUID) – The Fabric warehouse name or ID.
name (str) – The name of the restore point.
description (str, default=None) – The description of the restore point.
workspace (str | uuid.UUID, default=None) – The Fabric workspace name or ID. Defaults to None which resolves to the workspace of the attached lakehouse or if no lakehouse attached, resolves to the workspace of the notebook.
- sempy_labs.warehouse.create_warehouse(warehouse: str, description: str | None = None, case_insensitive_collation: bool = False, workspace: str | UUID | None = None) UUID
Creates a Fabric warehouse.
This is a wrapper function for the following API: Items - Create Warehouse.
Service Principal Authentication is supported (see here for examples).
- Parameters:
warehouse (str) – Name of the warehouse.
description (str, default=None) – A description of the warehouse.
case_insensitive_collation (bool, default=False) – If True, creates the warehouse with case-insensitive collation.
workspace (str | uuid.UUID, default=None) – The Fabric workspace name or ID. Defaults to None which resolves to the workspace of the attached lakehouse or if no lakehouse attached, resolves to the workspace of the notebook.
- Returns:
The ID of the created warehouse.
- Return type:
- sempy_labs.warehouse.delete_restore_point(warehouse: str | UUID, restore_point: str | UUID, workspace: str | UUID | None = None)
Deletes a restore point from a warehouse.
This is a wrapper function for the following API: Restore Points - Delete Restore Point.
- Parameters:
warehouse (str | uuid.UUID) – The Fabric warehouse name or ID.
restore_point (str | uuid.UUID) – The restore point name or ID.
workspace (str | uuid.UUID, default=None) – The Fabric workspace name or ID. Defaults to None which resolves to the workspace of the attached lakehouse or if no lakehouse attached, resolves to the workspace of the notebook.
- sempy_labs.warehouse.delete_warehouse(name: str | UUID, workspace: str | UUID | None = None)
Deletes a Fabric warehouse.
This is a wrapper function for the following API: Items - Delete Warehouse.
Service Principal Authentication is supported (see here for examples).
- sempy_labs.warehouse.disable_sql_pools_configuration(workspace: str | UUID | None = None)
Disables the SQL Pools configuration in the specified workspace.
When disabled, the existing configuration is preserved and can be restored by re-enabling.
This is a wrapper function for the following API: SQL Pools - Update Sql Pools Configuration.
Service Principal Authentication is supported (see here for examples).
- sempy_labs.warehouse.enable_sql_pools_configuration(custom_sql_pools: List[Dict[str, Any]] | None = None, workspace: str | UUID | None = None)
Enables the SQL Pools configuration in the specified workspace.
If custom_sql_pools is not provided, the previously saved configuration will be restored. If provided, the supplied pools will replace the existing configuration. Any existing SQL pool not included in the request will be deleted.
This is a wrapper function for the following API: SQL Pools - Update Sql Pools Configuration.
Service Principal Authentication is supported (see here for examples).
- Parameters:
custom_sql_pools (List[dict], default=None) – A list of SQL pool definitions to apply. Each dict may contain the keys:
name(str),isDefault(bool),maxResourcePercentage(int, 1-100),optimizeForReads(bool), andclassifier(dict withtypeandvaluekeys). If None, the previously saved configuration will be restored.workspace (str | uuid.UUID, default=None) – The Fabric workspace name or ID. Defaults to None which resolves to the workspace of the attached lakehouse or if no lakehouse attached, resolves to the workspace of the notebook.
- sempy_labs.warehouse.get_sql_pools_configuration(workspace: str | UUID | None = None) DataFrame
Gets the SQL Pools configuration in the specified workspace.
This is a wrapper function for the following API: SQL Pools - Get Sql Pools Configuration.
Service Principal Authentication is supported (see here for examples).
- Parameters:
workspace (str | uuid.UUID, default=None) – The Fabric workspace name or ID. Defaults to None which resolves to the workspace of the attached lakehouse or if no lakehouse attached, resolves to the workspace of the notebook.
- Returns:
A pandas dataframe showing the SQL pools configuration for the specified workspace.
- Return type:
- sempy_labs.warehouse.get_warehouse_columns(warehouse: str | UUID, workspace: str | UUID | None = None) DataFrame
Shows a list of the columns in each table within the Fabric warehouse. This function is based on INFORMATION_SCHEMA.COLUMNS.
- Parameters:
- Returns:
A pandas dataframe showing a list of the columns in each table within the Fabric warehouse.
- Return type:
- sempy_labs.warehouse.get_warehouse_tables(warehouse: str | UUID, workspace: str | UUID | None = None) DataFrame
Shows a list of the tables in the Fabric warehouse. This function is based on INFORMATION_SCHEMA.TABLES.
- Parameters:
- Returns:
A pandas dataframe showing a list of the tables in the Fabric warehouse.
- Return type:
- sempy_labs.warehouse.list_restore_points(warehouse: str | UUID, workspace: str | UUID | None = None) DataFrame
Returns all restore points for a warehouse.
This is a wrapper function for the following API: Restore Points - List Restore Points.
- Parameters:
- Returns:
A pandas dataframe showing all restore points for a warehouse.
- Return type:
- sempy_labs.warehouse.list_warehouses(workspace: str | UUID | None = None) DataFrame
Shows the warehouses within a workspace.
This is a wrapper function for the following API: Items - List Warehouses.
Service Principal Authentication is supported (see here for examples).
- Parameters:
workspace (str | uuid.UUID, default=None) – The Fabric workspace name or ID. Defaults to None which resolves to the workspace of the attached lakehouse or if no lakehouse attached, resolves to the workspace of the notebook.
- Returns:
A pandas dataframe showing the warehouses within a workspace.
- Return type:
- sempy_labs.warehouse.restore_to_restore_point(warehouse: str | UUID, restore_point: str | UUID, workspace: str | UUID | None = None)
Restores a warehouse in-place to the restore point specified.
This is a wrapper function for the following API: Restore Points - Restore To Restore Point.
- Parameters:
warehouse (str | uuid.UUID) – The Fabric warehouse name or ID.
restore_point (str | uuid.UUID) – The restore point name or ID.
workspace (str | uuid.UUID, default=None) – The Fabric workspace name or ID. Defaults to None which resolves to the workspace of the attached lakehouse or if no lakehouse attached, resolves to the workspace of the notebook.
- sempy_labs.warehouse.update_restore_point(warehouse: str | UUID, restore_point: str | UUID, name: str | None = None, description: str | None = None, workspace: str | UUID | None = None)
Updates a restore point in a warehouse.
This is a wrapper function for the following API: Restore Points - Update Restore Point.
- Parameters:
warehouse (str | uuid.UUID) – The Fabric warehouse name or ID.
restore_point (str | uuid.UUID) – The restore point name or ID.
name (str, default=None) – The new name of the restore point.
description (str, default=None) – The new description of the restore point.
workspace (str | uuid.UUID, default=None) – The Fabric workspace name or ID. Defaults to None which resolves to the workspace of the attached lakehouse or if no lakehouse attached, resolves to the workspace of the notebook.