Skip to content

Commit 85649c2

Browse files
committed
feat: Adding support for index renaming.
1 parent a15246e commit 85649c2

File tree

2 files changed

+4
-7
lines changed

2 files changed

+4
-7
lines changed

meilisearch/index.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2355,4 +2355,3 @@ def compact(self) -> TaskInfo:
23552355
path = f"{self.config.paths.index}/{self.uid}/compact"
23562356
task = self.http.post(path)
23572357
return TaskInfo(**task)
2358-

tests/client/test_client_swap_meilisearch.py

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -45,21 +45,21 @@ def test_swap_indexes_with_one_that_does_not_exist(client, empty_index):
4545
assert swapTask.type == "indexSwap"
4646
assert task.error["code"] == "index_not_found"
4747

48+
4849
def test_swap_indexes_with_one_that_does_not_exist_with_rename_as_false(client, empty_index):
4950
"""Tests swap indexes with one that does not exist."""
5051
index = empty_index("index_A")
5152
swapTask = client.swap_indexes(
5253
[
53-
{
54-
"indexes": [index.uid, "does_not_exist"], "rename": False
55-
},
54+
{"indexes": [index.uid, "does_not_exist"], "rename": False},
5655
]
5756
)
5857
task = client.wait_for_task(swapTask.task_uid)
5958

6059
assert swapTask.type == "indexSwap"
6160
assert task.error["code"] == "index_not_found"
6261

62+
6363
def test_swap_indexes_with_itself(client, empty_index):
6464
"""Tests swap indexes with itself."""
6565
index = empty_index()
@@ -79,9 +79,7 @@ def test_swap_indexes_with_one_that_does_not_exist_with_rename_as_true(client, e
7979
renamed_index_name = "new_index_name"
8080
swapTask = client.swap_indexes(
8181
[
82-
{
83-
"indexes": [index.uid, renamed_index_name], "rename": True
84-
},
82+
{"indexes": [index.uid, renamed_index_name], "rename": True},
8583
]
8684
)
8785
client.wait_for_task(swapTask.task_uid)

0 commit comments

Comments
 (0)