sempy_labs.warehouse_snapshot package

Module contents

sempy_labs.warehouse_snapshot.create_warehouse_snapshot(name: str, parent_warehouse: str | UUID, parent_warehouse_workspace: str | UUID | None = None, warehouse_snapshot_workspace: str | UUID | None = None, description: str | None = None, snapshot_datetime: datetime | None = None)

Creates a Warehouse snapshot in the specified workspace.

This is a wrapper function for the following API: Items - Create Warehouse Snapshot.

Service Principal Authentication is supported (see here for examples).

Parameters:
  • name (str) – The name of the warehouse snapshot to create.

  • parent_warehouse (str | uuid.UUID) – The name or ID of the parent warehouse to snapshot.

  • parent_warehouse_workspace (str | uuid.UUID, default=None) – The workspace name or ID where the parent warehouse is located. Defaults to None which resolves to the workspace of the attached lakehouse or if no lakehouse attached, resolves to the workspace of the notebook.

  • warehouse_snapshot_workspace (str | uuid.UUID, default=None) – The workspace name or ID where the warehouse snapshot will be created. Defaults to None which resolves to the workspace of the attached lakehouse or if no lakehouse attached, resolves to the workspace of the notebook.

  • description (str, default=None) – A description for the warehouse snapshot.

  • snapshot_datetime (datetime, default=None) – The datetime for the snapshot. If not provided, the current datetime will be used. Example: “2024-10-15T13:00:00Z”

sempy_labs.warehouse_snapshot.delete_warehouse_snapshot(warehouse_snapshot: str | UUID, workspace: str | UUID | None = None)

Deletes a warehouse snapshot in the Fabric workspace.

This is a wrapper function for the following API: Items - Delete Warehouse Snapshot.

Service Principal Authentication is supported (see here for examples).

sempy_labs.warehouse_snapshot.list_warehouse_snapshots(workspace: str | UUID | None = None) DataFrame

Lists all warehouse snapshots for a given warehouse.

This is a wrapper function for the following API: Items - List Warehouse Snapshots.

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 containing the list of warehouse snapshots within the workspace.

Return type:

pandas.DataFrame

sempy_labs.warehouse_snapshot.update_warehouse_snapshot(warehouse_snapshot: str | UUID, name: str | None = None, description: str | None = None, snapshot_datetime: datetime | None = None, workspace: str | UUID | None = None)

Updates the properties of a warehouse snapshot in the Fabric workspace.

This is a wrapper function for the following API: Items - Update Warehouse Snapshot.

Service Principal Authentication is supported (see here for examples).

Parameters:
  • warehouse_snapshot (str | uuid.UUID) – The name or ID of the warehouse snapshot to update.

  • name (str, optional) – The new name for the warehouse snapshot.

  • description (str, optional) – The new description for the warehouse snapshot.

  • snapshot_datetime (datetime, optional) – The new snapshot datetime for the warehouse snapshot. Example: “2024-10-15T13:00:00Z”

  • workspace (str | uuid.UUID, optional) – 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.