diff --git a/clients/python-wrapper/lakefs/branch.py b/clients/python-wrapper/lakefs/branch.py index 28dff37b045..ab25f1183e7 100644 --- a/clients/python-wrapper/lakefs/branch.py +++ b/clients/python-wrapper/lakefs/branch.py @@ -228,9 +228,6 @@ def reset_changes(self, path_type: Literal["common_prefix", "object", "reset"] = reset_creation = lakefs_sdk.ResetCreation(path=path, type=path_type) return self._client.sdk_client.branches_api.reset_branch(self._repo_id, self.id, reset_creation) - def __repr__(self): - return f'Branch(repository="{self.repo_id}", id="{self.id}")' - class Transaction(Branch): """ @@ -243,6 +240,3 @@ def __init__(self, repository_id: str, branch_id: str, commit_message: str, clie # TODO: Implement and check if we are OK with transaction returning a branch # with capabilities such as commit and transaction - - def __repr__(self): - return f'Transaction(repository="{self.repo_id}", branch_id="{self.id}")' diff --git a/clients/python-wrapper/lakefs/reference.py b/clients/python-wrapper/lakefs/reference.py index 280d1fdc51a..48a2f23798b 100644 --- a/clients/python-wrapper/lakefs/reference.py +++ b/clients/python-wrapper/lakefs/reference.py @@ -170,7 +170,8 @@ def object(self, path: str) -> StoredObject: # pylint: disable=C0103 return StoredObject(self._repo_id, self._id, path, self._client) def __repr__(self): - return f'Reference(repository="{self.repo_id}", id="{self.id}")' + class_name = self.__class__.__name__ + return f'{class_name}(repository="{self.repo_id}", id="{self.id}")' def generate_listing(func, *args, max_amount: Optional[int] = None, **kwargs): diff --git a/clients/python-wrapper/lakefs/tag.py b/clients/python-wrapper/lakefs/tag.py index a7357370be9..81ecf6c98c9 100644 --- a/clients/python-wrapper/lakefs/tag.py +++ b/clients/python-wrapper/lakefs/tag.py @@ -50,6 +50,3 @@ def delete(self) -> None: with api_exception_handler(): self._client.sdk_client.tags_api.delete_tag(self._repo_id, self.id) self._commit = None - - def __repr__(self): - return f'Tag(repository="{self.repo_id}", id="{self.id}")'