1010from mock_tests .conftest import MOCK_IP , MOCK_PORT , MOCK_PORT_GRPC
1111from weaviate .collections .classes .config import (
1212 DataType ,
13- PropertyIndexState ,
14- PropertyIndexTaskStatus ,
15- PropertyIndexType ,
13+ InvertedIndexState ,
14+ InvertedIndexTaskStatus ,
15+ InvertedIndexType ,
1616 Tokenization ,
1717)
1818from weaviate .exceptions import (
@@ -64,7 +64,7 @@ def test_update_property_index_started(
6464 algorithm = "blockmax" ,
6565 )
6666 assert task .task_id == TASK_ID
67- assert task .status == PropertyIndexTaskStatus .STARTED
67+ assert task .status == InvertedIndexTaskStatus .STARTED
6868 weaviate_139_mock .check_assertions ()
6969
7070
@@ -81,7 +81,7 @@ def test_update_property_index_no_op(
8181 "name" , "searchable" , tokenization = Tokenization .WORD
8282 )
8383 assert task .task_id is None
84- assert task .status == PropertyIndexTaskStatus .NO_OP
84+ assert task .status == InvertedIndexTaskStatus .NO_OP
8585 weaviate_139_mock .check_assertions ()
8686
8787
@@ -100,7 +100,7 @@ def test_update_property_index_range_filters_with_tenants(
100100 "age" , "rangeFilters" , tenants = ["tenant1" , "tenant2" ]
101101 )
102102 assert task .task_id == TASK_ID
103- assert task .status == PropertyIndexTaskStatus .STARTED
103+ assert task .status == InvertedIndexTaskStatus .STARTED
104104 weaviate_139_mock .check_assertions ()
105105
106106
@@ -129,7 +129,7 @@ def test_update_property_index_wait_for_completion(
129129 "name" , "searchable" , tokenization = Tokenization .WORD , wait_for_completion = True
130130 )
131131 assert status .type == "searchable"
132- assert status .status == PropertyIndexState .READY
132+ assert status .status == InvertedIndexState .READY
133133 assert status .tokenization == Tokenization .WORD
134134 weaviate_139_mock .check_assertions ()
135135
@@ -148,7 +148,7 @@ def test_update_property_index_bare_str_tenant(
148148 task = client_139 .collections .use (COLLECTION ).config .update_property_index (
149149 "age" , "rangeFilters" , tenants = "tenant1"
150150 )
151- assert task .status == PropertyIndexTaskStatus .STARTED
151+ assert task .status == InvertedIndexTaskStatus .STARTED
152152 weaviate_139_mock .check_assertions ()
153153
154154
@@ -251,7 +251,7 @@ def test_rebuild_property_index(
251251 "name" , "searchable"
252252 )
253253 assert task .task_id == TASK_ID
254- assert task .status == PropertyIndexTaskStatus .STARTED
254+ assert task .status == InvertedIndexTaskStatus .STARTED
255255 weaviate_139_mock .check_assertions ()
256256
257257
@@ -269,7 +269,7 @@ def test_rebuild_property_index_with_tenants(
269269 "age" , "rangeFilters" , tenants = ["tenant1" , "tenant2" ]
270270 )
271271 assert task .task_id == TASK_ID
272- assert task .status == PropertyIndexTaskStatus .STARTED
272+ assert task .status == InvertedIndexTaskStatus .STARTED
273273 weaviate_139_mock .check_assertions ()
274274
275275
@@ -286,7 +286,7 @@ def test_cancel_property_index_task_cancelled(
286286 "name" , "searchable"
287287 )
288288 assert task .task_id == TASK_ID
289- assert task .status == PropertyIndexTaskStatus .CANCELLED
289+ assert task .status == InvertedIndexTaskStatus .CANCELLED
290290 weaviate_139_mock .check_assertions ()
291291
292292
@@ -303,7 +303,7 @@ def test_cancel_property_index_task_no_op(
303303 "name" , "searchable"
304304 )
305305 assert task .task_id is None
306- assert task .status == PropertyIndexTaskStatus .NO_OP
306+ assert task .status == InvertedIndexTaskStatus .NO_OP
307307 weaviate_139_mock .check_assertions ()
308308
309309
@@ -360,7 +360,7 @@ def test_get_property_indexes(
360360 assert len (name .indexes ) == 2
361361 searchable , filterable = name .indexes
362362 assert searchable .type == "searchable"
363- assert searchable .status == PropertyIndexState .INDEXING
363+ assert searchable .status == InvertedIndexState .INDEXING
364364 assert searchable .progress == 0.5
365365 assert searchable .task_id == TASK_ID
366366 assert searchable .tokenization == Tokenization .WORD
@@ -379,7 +379,7 @@ def test_get_property_indexes(
379379 assert age .description is None
380380 assert len (age .indexes ) == 1
381381 assert age .indexes [0 ].type == "rangeFilters"
382- assert age .indexes [0 ].status == PropertyIndexState .READY
382+ assert age .indexes [0 ].status == InvertedIndexState .READY
383383 assert age .indexes [0 ].progress is None
384384 assert age .indexes [0 ].task_id is None
385385 assert age .indexes [0 ].tokenization is None
@@ -398,18 +398,18 @@ def test_get_property_indexes(
398398@pytest .mark .parametrize (
399399 "index_name,wire" ,
400400 [
401- (PropertyIndexType .SEARCHABLE , "searchable" ),
401+ (InvertedIndexType .SEARCHABLE , "searchable" ),
402402 ("searchable" , "searchable" ),
403- (PropertyIndexType .FILTERABLE , "filterable" ),
403+ (InvertedIndexType .FILTERABLE , "filterable" ),
404404 ("filterable" , "filterable" ),
405- (PropertyIndexType .RANGE_FILTERS , "rangeFilters" ),
405+ (InvertedIndexType .RANGE_FILTERS , "rangeFilters" ),
406406 ("rangeFilters" , "rangeFilters" ),
407407 ],
408408)
409409def test_update_property_index_enum_and_literal_hit_same_route (
410410 weaviate_139_mock : HTTPServer ,
411411 client_139 : weaviate .WeaviateClient ,
412- index_name : Union [PropertyIndexType , str ],
412+ index_name : Union [InvertedIndexType , str ],
413413 wire : str ,
414414) -> None :
415415 """The enum and literal forms of index_name hit the exact same wire route."""
@@ -423,25 +423,25 @@ def test_update_property_index_enum_and_literal_hit_same_route(
423423 "name" ,
424424 index_name , # type: ignore
425425 )
426- assert task .status == PropertyIndexTaskStatus .STARTED
426+ assert task .status == InvertedIndexTaskStatus .STARTED
427427 weaviate_139_mock .check_assertions ()
428428
429429
430430@pytest .mark .parametrize (
431431 "index_name,wire" ,
432432 [
433- (PropertyIndexType .SEARCHABLE , "searchable" ),
433+ (InvertedIndexType .SEARCHABLE , "searchable" ),
434434 ("searchable" , "searchable" ),
435- (PropertyIndexType .FILTERABLE , "filterable" ),
435+ (InvertedIndexType .FILTERABLE , "filterable" ),
436436 ("filterable" , "filterable" ),
437- (PropertyIndexType .RANGE_FILTERS , "rangeFilters" ),
437+ (InvertedIndexType .RANGE_FILTERS , "rangeFilters" ),
438438 ("rangeFilters" , "rangeFilters" ),
439439 ],
440440)
441441def test_delete_property_index_enum_and_literal_hit_same_route (
442442 weaviate_139_mock : HTTPServer ,
443443 client_139 : weaviate .WeaviateClient ,
444- index_name : Union [PropertyIndexType , str ],
444+ index_name : Union [InvertedIndexType , str ],
445445 wire : str ,
446446) -> None :
447447 """The enum and literal forms of index_name hit the exact same wire route."""
@@ -462,12 +462,12 @@ def test_delete_property_index_enum_and_literal_hit_same_route(
462462
463463@pytest .mark .parametrize (
464464 "index_name" ,
465- [PropertyIndexType .RANGE_FILTERS , "rangeFilters" ],
465+ [InvertedIndexType .RANGE_FILTERS , "rangeFilters" ],
466466)
467467def test_rebuild_property_index_enum_and_literal_hit_same_route (
468468 weaviate_139_mock : HTTPServer ,
469469 client_139 : weaviate .WeaviateClient ,
470- index_name : Union [PropertyIndexType , str ],
470+ index_name : Union [InvertedIndexType , str ],
471471) -> None :
472472 """The enum and literal forms of index_name hit the exact same rebuild route."""
473473 weaviate_139_mock .expect_request (
@@ -480,18 +480,18 @@ def test_rebuild_property_index_enum_and_literal_hit_same_route(
480480 "age" ,
481481 index_name , # type: ignore
482482 )
483- assert task .status == PropertyIndexTaskStatus .STARTED
483+ assert task .status == InvertedIndexTaskStatus .STARTED
484484 weaviate_139_mock .check_assertions ()
485485
486486
487487@pytest .mark .parametrize (
488488 "index_name" ,
489- [PropertyIndexType .RANGE_FILTERS , "rangeFilters" ],
489+ [InvertedIndexType .RANGE_FILTERS , "rangeFilters" ],
490490)
491491def test_cancel_property_index_task_enum_and_literal_hit_same_route (
492492 weaviate_139_mock : HTTPServer ,
493493 client_139 : weaviate .WeaviateClient ,
494- index_name : Union [PropertyIndexType , str ],
494+ index_name : Union [InvertedIndexType , str ],
495495) -> None :
496496 """The enum and literal forms of index_name hit the exact same cancel route."""
497497 weaviate_139_mock .expect_request (
@@ -504,7 +504,7 @@ def test_cancel_property_index_task_enum_and_literal_hit_same_route(
504504 "age" ,
505505 index_name , # type: ignore
506506 )
507- assert task .status == PropertyIndexTaskStatus .CANCELLED
507+ assert task .status == InvertedIndexTaskStatus .CANCELLED
508508 weaviate_139_mock .check_assertions ()
509509
510510
0 commit comments