Skip to content

Commit

Permalink
Fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
dirkkul committed Aug 29, 2024
1 parent 4084cc7 commit ded2592
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 10 deletions.
2 changes: 1 addition & 1 deletion integration_v3/test_backup_v4.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ def test_create_and_restore_backup_with_waiting(client: weaviate.WeaviateClient)
# check create status
create_status = client.backup.get_create_status(backup_id, BACKEND)
assert create_status.status == BackupStatus.SUCCESS
assert create_status.path == backup_id
assert create_status.backup_id == backup_id

# remove existing class
client.collections.delete("Article")
Expand Down
14 changes: 7 additions & 7 deletions weaviate/backup/backup.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,11 @@
BackupFailedException,
EmptyResponseException,
)
from weaviate.util import _capitalize_first_letter, _decode_json_response_dict, _decode_json_response_list
from weaviate.util import (
_capitalize_first_letter,
_decode_json_response_dict,
_decode_json_response_list,
)

STORAGE_NAMES = {
"filesystem",
Expand Down Expand Up @@ -360,9 +364,7 @@ async def get_restore_status(
"""
return await self.__get_restore_status(backup_id, backend)

async def __cancel_backup(
self, backup_id: str, backend: BackupStorage
) -> bool:
async def __cancel_backup(self, backup_id: str, backend: BackupStorage) -> bool:
backup_id, backend = _get_and_validate_get_status(
backup_id=backup_id,
backend=backend,
Expand All @@ -381,9 +383,7 @@ async def __cancel_backup(
else:
return False # did not exist

async def cancel_backup(
self, backup_id: str, backend: BackupStorage
) -> bool:
async def cancel_backup(self, backup_id: str, backend: BackupStorage) -> bool:
"""
Cancels a running backup.
Expand Down
8 changes: 6 additions & 2 deletions weaviate/collections/backups/backups.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,9 @@ async def create(
create = await self._backup.create(
backup_id, backend, [self._name], None, wait_for_completion, config
)
return BackupStatusReturn(error=create.error, status=create.status, path=create.path, id=backup_id)
return BackupStatusReturn(
error=create.error, status=create.status, path=create.path, id=backup_id
)

async def restore(
self,
Expand Down Expand Up @@ -97,7 +99,9 @@ async def restore(
restore = await self._backup.restore(
backup_id, backend, [self._name], None, wait_for_completion, config
)
return BackupStatusReturn(error=restore.error, status=restore.status, path=restore.path, id=backup_id)
return BackupStatusReturn(
error=restore.error, status=restore.status, path=restore.path, id=backup_id
)

async def get_create_status(self, backup_id: str, backend: BackupStorage) -> BackupStatusReturn:
"""Check if a started backup job has completed.
Expand Down

0 comments on commit ded2592

Please sign in to comment.