Skip to content

Commit

Permalink
feat(client): adapt openaAPI "deleteBranch"
Browse files Browse the repository at this point in the history
PR Closed: #616
  • Loading branch information
rexzheng324-c committed Jun 2, 2021
1 parent 64c155d commit e286734
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions tensorbay/client/dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -402,6 +402,17 @@ def list_branches(self) -> PagingList[Branch]:
"""
return PagingList(lambda offset, limit: self._generate_branches(None, offset, limit), 128)

def delete_branch(self, name: str) -> None:
"""Delete a branch.
Arguments:
name: The name of the branch to be deleted.
"""
delete_data: Dict[str, Any] = {"name": name}

self._client.open_api_do("DELETE", "branches", self.dataset_id, json=delete_data)

def checkout(self, revision: Optional[str] = None, draft_number: Optional[int] = None) -> None:
"""Checkout to commit or draft.
Expand Down

0 comments on commit e286734

Please sign in to comment.