sempy_labs.git package

Module contents

sempy_labs.git.commit_to_git(comment: str, item_ids: UUID | List[UUID] = None, workspace: str | UUID | None = None)

Commits all or a selection of items within a workspace to Git.

This is a wrapper function for the following API: Git - Commit to Git.

Parameters:
  • comment (str) – The Git commit comment.

  • item_ids (uuid.UUID | List[uuid.UUID], default=None) – A list of item Ids to commit to Git. Defaults to None which commits all items to Git.

  • 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.git.connect_workspace_to_azure_dev_ops(organization_name: str, project_name: str, repository_name: str, branch_name: str, directory_name: str, workspace: str | UUID | None = None)

Connects a workspace to an Azure DevOps git repository.

This is a wrapper function for the following API: Git - Connect.

Parameters:
  • organization_name (str) – The organization name.

  • project_name (str) – The project name.

  • repository_name (str) – The repository name.

  • branch_name (str) – The branch name.

  • directory_name (str) – The directory name.

  • 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.git.connect_workspace_to_github(owner_name: str, repository_name: str, branch_name: str, directory_name: str, connection_id: UUID, source: Literal['ConfiguredConnection', 'Automatic', 'None'] = 'ConfiguredConnection', workspace: str | UUID | None = None)

Connects a workspace to a GitHub git repository.

This is a wrapper function for the following API: Git - Connect.

Parameters:
  • owner_name (str) – The owner name.

  • repository_name (str) – The repository name.

  • branch_name (str) – The branch name.

  • directory_name (str) – The directory name.

  • connection_id (uuid.UUID) – The object ID of the connection.

  • source (Literal["ConfiguredConnection", "Automatic", "None"], default="ConfiguredConnection") – The Git credentials source.

  • 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.git.disconnect_workspace_from_git(workspace: str | UUID | None = None)

Disconnects a workspace from a git repository.

This is a wrapper function for the following API: Git - Disconnect.

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.

sempy_labs.git.get_connection(workspace: str | UUID | None = None) DataFrame

Obtains the Git status of items in the workspace, that can be committed to Git.

This is a wrapper function for the following API: Git - Get Connection.

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 Git status of items in the workspace.

Return type:

pandas.DataFrame

sempy_labs.git.get_my_git_credentials(workspace: str | UUID | None = None) DataFrame

Returns the user’s Git credentials configuration details.

This is a wrapper function for the following API: Git - Get My Git Credentials.

Parameters:

workspace (str | uuid.UUID, default=None) – The 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 user’s Git credentials configuration details.

Return type:

pandas.DataFrame

sempy_labs.git.get_status(workspace: str | UUID | None = None) DataFrame

Obtains the Git status of items in the workspace, that can be committed to Git.

This is a wrapper function for the following API: Git - Get Status.

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 Git status of items in the workspace.

Return type:

pandas.DataFrame

sempy_labs.git.initialize_connection(workspace: str | UUID | None = None) str

Initializes a connection for a workspace that is connected to Git.

This is a wrapper function for the following API: Git - Initialize Connection.

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:

Remote full SHA commit hash.

Return type:

str

sempy_labs.git.update_from_git(remote_commit_hash: str, conflict_resolution_policy: str, workspace_head: str | None = None, allow_override: bool = False, workspace: str | UUID | None = None)

Updates the workspace with commits pushed to the connected branch.

This is a wrapper function for the following API: Git - Update From Git.

Parameters:
  • remote_commit_hash (str) – Remote full SHA commit hash.

  • confilict_resolution_policy (str) – The conflict resolution policy.

  • workspace_head (str) – Full SHA hash that the workspace is synced to. This value may be null only after Initialize Connection. In other cases, the system will validate that the given value is aligned with the head known to the system.

  • allow_override (bool, default=False) – User consent to override incoming items during the update from Git process. When incoming items are present and the allow override items is not specified or is provided as false, the update operation will not start. Default value is false.

  • 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.git.update_my_git_credentials(source: str, connection_id: UUID | None = None, workspace: str | UUID | None = None)

Updates the user’s Git credentials configuration details.

This is a wrapper function for the following API: Git - Update My Git Credentials.

Parameters:
  • source (str) – The Git credentials source. Valid options: ‘Automatic’, ‘ConfiguredConnection’, ‘None’.

  • connection_id (UUID, default=None) – The object ID of the connection. Valid only for the ‘ConfiguredConnection’ source.

  • workspace (str | uuid.UUID, default=None) – The 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.