Skip to content

Commit 4f611b6

Browse files
authored
Merge pull request #1647 from weaviate/chore/remove-tests-for-no-longer-tested-versions
Remove all tests for <1.24 version
2 parents b2bc66d + 02a5551 commit 4f611b6

6 files changed

Lines changed: 14 additions & 128 deletions

File tree

integration/test_backup_v4.py

Lines changed: 0 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
)
1717
from weaviate.collections.classes.config import DataType, Property, ReferenceProperty
1818
from weaviate.exceptions import (
19-
WeaviateUnsupportedFeatureError,
2019
UnexpectedStatusCodeException,
2120
BackupFailedException,
2221
)
@@ -455,37 +454,6 @@ def test_backup_and_restore_with_collection_and_config_1_24_x(
455454
assert restore_status.status == BackupStatus.SUCCESS
456455

457456

458-
def test_backup_and_restore_with_collection_and_config_1_23_x(
459-
client: weaviate.WeaviateClient,
460-
) -> None:
461-
if client._connection._weaviate_version.is_at_least(1, 24, 0):
462-
pytest.skip("Backup config is supported from Weaviate 1.24.0")
463-
464-
backup_id = _create_backup_id()
465-
466-
article = client.collections.use("Article")
467-
468-
with pytest.raises(WeaviateUnsupportedFeatureError):
469-
article.backup.create(
470-
backup_id=backup_id,
471-
backend=BACKEND,
472-
wait_for_completion=True,
473-
config=BackupConfigCreate(
474-
cpu_percentage=60,
475-
chunk_size=256,
476-
compression_level=BackupCompressionLevel.BEST_SPEED,
477-
),
478-
)
479-
480-
with pytest.raises(WeaviateUnsupportedFeatureError):
481-
article.backup.restore(
482-
backup_id=backup_id,
483-
backend=BACKEND,
484-
wait_for_completion=True,
485-
config=BackupConfigRestore(cpu_percentage=70),
486-
)
487-
488-
489457
# did not make it into 1.27, will come later
490458
# def test_list_backup(client: weaviate.WeaviateClient) -> None:
491459
# """Create and restore backup without waiting."""

integration/test_client.py

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -282,9 +282,6 @@ def test_create_export_and_recreate(client: weaviate.WeaviateClient, request: Su
282282
def test_create_export_and_recreate_named_vectors(
283283
client: weaviate.WeaviateClient, request: SubRequest
284284
) -> None:
285-
if client._connection._weaviate_version.is_lower_than(1, 24, 0):
286-
pytest.skip("Named vectors are not supported in versions lower than 1.24.0")
287-
288285
name1 = request.node.name
289286
name2 = request.node.name + "2"
290287
client.collections.delete([name1, name2])
@@ -352,10 +349,7 @@ def test_client_cluster_with_lazy_shard_loading(
352349
assert nodes[0].shards[0].vector_indexing_status == "READY"
353350
assert nodes[0].shards[0].vector_queue_length == 0
354351
assert nodes[0].shards[0].compressed is False
355-
if collection._connection._weaviate_version.is_lower_than(1, 24, 0):
356-
assert nodes[0].shards[0].loaded is None
357-
else:
358-
assert nodes[0].shards[0].loaded is True
352+
assert nodes[0].shards[0].loaded is True
359353
finally:
360354
client.collections.delete(request.node.name)
361355

@@ -377,9 +371,7 @@ def test_client_cluster_without_lazy_shard_loading(
377371
assert nodes[0].shards[0].vector_indexing_status == "READY"
378372
assert nodes[0].shards[0].vector_queue_length == 0
379373
assert nodes[0].shards[0].compressed is False
380-
if collection._connection._weaviate_version.is_lower_than(1, 24, 0):
381-
assert nodes[0].shards[0].loaded is None
382-
elif collection._connection._weaviate_version.is_lower_than(1, 25, 0):
374+
if collection._connection._weaviate_version.is_lower_than(1, 25, 0):
383375
assert nodes[0].shards[0].loaded is True
384376
else:
385377
assert nodes[0].shards[0].loaded is False

integration/test_collection_aggregate.py

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -386,21 +386,15 @@ def test_hybrid_aggregation_group_by(
386386
def test_hybrid_aggregation_group_by_with_named_vectors(
387387
collection_factory: CollectionFactory, group_by: Union[str, GroupByAggregate]
388388
) -> None:
389-
dummy = collection_factory("dummy")
390-
collection_maker = lambda: collection_factory(
389+
collection = collection_factory(
391390
properties=[Property(name="text", data_type=DataType.TEXT)],
392391
vectorizer_config=[
393392
Configure.NamedVectors.text2vec_contextionary(
394393
name="all", vectorize_collection_name=False
395394
)
396395
],
397396
)
398-
if dummy._connection._weaviate_version.is_lower_than(1, 24, 0):
399-
with pytest.raises(WeaviateInvalidInputError):
400-
collection_maker()
401-
return
402397

403-
collection = collection_maker()
404398
text_1 = "some text"
405399
text_2 = "nothing like the other one at all, not even a little bit"
406400
collection.data.insert({"text": text_1})
@@ -415,7 +409,7 @@ def test_hybrid_aggregation_group_by_with_named_vectors(
415409
object_limit=2, # has no effect due to alpha=0
416410
target_vector="all",
417411
)
418-
if dummy._connection._weaviate_version.is_lower_than(1, 25, 0):
412+
if collection._connection._weaviate_version.is_lower_than(1, 25, 0):
419413
with pytest.raises(WeaviateUnsupportedFeatureError):
420414
querier()
421415
return

integration/test_collection_config.py

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -575,10 +575,6 @@ def test_collection_config_update(collection_factory: CollectionFactory) -> None
575575

576576

577577
def test_hnsw_with_bq(collection_factory: CollectionFactory) -> None:
578-
dummy = collection_factory("dummy")
579-
if dummy._connection._weaviate_version.is_lower_than(1, 24, 0):
580-
pytest.skip("BQ+HNSW is not supported in Weaviate versions lower than 1.24.0")
581-
582578
collection = collection_factory(
583579
vector_index_config=Configure.VectorIndex.hnsw(
584580
vector_cache_max_objects=5,
@@ -1199,10 +1195,6 @@ def test_create_custom_vectorizer(collection_factory: CollectionFactory) -> None
11991195

12001196

12011197
def test_create_custom_vectorizer_named(collection_factory: CollectionFactory) -> None:
1202-
collection_dummy = collection_factory("dummy")
1203-
if collection_dummy._connection._weaviate_version.is_lower_than(1, 24, 0):
1204-
pytest.skip("Named index is not supported in Weaviate versions lower than 1.24.0")
1205-
12061198
collection = collection_factory(
12071199
properties=[Property(name="text", data_type=DataType.TEXT)],
12081200
vectorizer_config=[

integration/test_collection_hybrid.py

Lines changed: 2 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@
2222
)
2323
from weaviate.collections.classes.internal import Object
2424
from weaviate.exceptions import (
25-
WeaviateInvalidInputError,
2625
WeaviateUnsupportedFeatureError,
2726
)
2827

@@ -215,8 +214,7 @@ def test_hybrid_near_vector_search(collection_factory: CollectionFactory) -> Non
215214

216215

217216
def test_hybrid_near_vector_search_named_vectors(collection_factory: CollectionFactory) -> None:
218-
dummy = collection_factory("dummy")
219-
collection_maker = lambda: collection_factory(
217+
collection = collection_factory(
220218
properties=[
221219
Property(name="text", data_type=DataType.TEXT),
222220
Property(name="int", data_type=DataType.INT),
@@ -231,12 +229,6 @@ def test_hybrid_near_vector_search_named_vectors(collection_factory: CollectionF
231229
],
232230
)
233231

234-
if dummy._connection._weaviate_version.is_lower_than(1, 24, 0):
235-
with pytest.raises(WeaviateInvalidInputError):
236-
collection_maker()
237-
return
238-
239-
collection = collection_maker()
240232
uuid_banana = collection.data.insert({"text": "banana"})
241233
collection.data.insert({"text": "dog"})
242234
collection.data.insert({"text": "different concept"})
@@ -325,8 +317,7 @@ def test_hybrid_near_text_search(collection_factory: CollectionFactory) -> None:
325317

326318

327319
def test_hybrid_near_text_search_named_vectors(collection_factory: CollectionFactory) -> None:
328-
dummy = collection_factory("dummy")
329-
collection_maker = lambda: collection_factory(
320+
collection = collection_factory(
330321
properties=[
331322
Property(name="text", data_type=DataType.TEXT),
332323
Property(name="int", data_type=DataType.INT),
@@ -340,12 +331,7 @@ def test_hybrid_near_text_search_named_vectors(collection_factory: CollectionFac
340331
),
341332
],
342333
)
343-
if dummy._connection._weaviate_version.is_lower_than(1, 24, 0):
344-
with pytest.raises(WeaviateInvalidInputError):
345-
collection_maker()
346-
return
347334

348-
collection = collection_maker()
349335
uuid_banana_pudding = collection.data.insert({"text": "banana pudding"})
350336
collection.data.insert({"text": "banana smoothie"})
351337
collection.data.insert({"text": "different concept"})

integration/test_named_vectors.py

Lines changed: 8 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -21,40 +21,14 @@
2121
from weaviate.types import INCLUDE_VECTOR
2222

2323

24-
def test_create_named_vectors_throws_error_in_old_version(
25-
collection_factory: CollectionFactory,
26-
) -> None:
27-
collection = collection_factory("dummy")
28-
if not collection._connection._weaviate_version.is_lower_than(1, 24, 0):
29-
pytest.skip("Named vectors are supported in versions higher than 1.24.0")
30-
31-
with pytest.raises(WeaviateInvalidInputError):
32-
collection_factory(
33-
properties=[
34-
wvc.config.Property(name="title", data_type=wvc.config.DataType.TEXT),
35-
wvc.config.Property(name="content", data_type=wvc.config.DataType.TEXT),
36-
],
37-
vectorizer_config=[
38-
wvc.config.Configure.NamedVectors.text2vec_contextionary(
39-
"title", source_properties=["title"], vectorize_collection_name=False
40-
),
41-
wvc.config.Configure.NamedVectors.text2vec_contextionary(
42-
name="content", source_properties=["content"], vectorize_collection_name=False
43-
),
44-
],
45-
)
46-
47-
4824
@pytest.mark.parametrize(
4925
"include_vector",
5026
[["title", "content", "All", "AllExplicit", "bringYourOwn", "bringYourOwn2"], True],
5127
)
5228
def test_create_named_vectors(
5329
collection_factory: CollectionFactory, include_vector: Union[List[str], bool]
5430
) -> None:
55-
collection = collection_factory("dummy")
56-
if collection._connection._weaviate_version.is_lower_than(1, 24, 0):
57-
pytest.skip("Named vectors are not supported in versions lower than 1.24.0")
31+
5832
collection = collection_factory(
5933
properties=[
6034
wvc.config.Property(name="title", data_type=wvc.config.DataType.TEXT),
@@ -107,9 +81,7 @@ def test_create_named_vectors(
10781

10882

10983
def test_insert_many_add(collection_factory: CollectionFactory) -> None:
110-
collection = collection_factory("dummy")
111-
if collection._connection._weaviate_version.is_lower_than(1, 24, 0):
112-
pytest.skip("Named vectors are not supported in versions lower than 1.24.0")
84+
11385
collection = collection_factory(
11486
properties=[
11587
wvc.config.Property(name="title", data_type=wvc.config.DataType.TEXT),
@@ -139,9 +111,6 @@ def test_insert_many_add(collection_factory: CollectionFactory) -> None:
139111

140112

141113
def test_update(collection_factory: CollectionFactory) -> None:
142-
collection = collection_factory("dummy")
143-
if collection._connection._weaviate_version.is_lower_than(1, 24, 0):
144-
pytest.skip("Named vectors are not supported in versions lower than 1.24.0")
145114

146115
collection = collection_factory(
147116
properties=[
@@ -174,9 +143,6 @@ def test_update(collection_factory: CollectionFactory) -> None:
174143

175144

176145
def test_replace(collection_factory: CollectionFactory) -> None:
177-
collection = collection_factory("dummy")
178-
if collection._connection._weaviate_version.is_lower_than(1, 24, 0):
179-
pytest.skip("Named vectors are not supported in versions lower than 1.24.0")
180146

181147
collection = collection_factory(
182148
properties=[
@@ -210,9 +176,7 @@ def test_replace(collection_factory: CollectionFactory) -> None:
210176

211177

212178
def test_query(collection_factory: CollectionFactory) -> None:
213-
collection = collection_factory("dummy")
214-
if collection._connection._weaviate_version.is_lower_than(1, 24, 0):
215-
pytest.skip("Named vectors are not supported in versions lower than 1.24.0")
179+
216180
collection = collection_factory(
217181
properties=[
218182
wvc.config.Property(name="title", data_type=wvc.config.DataType.TEXT),
@@ -288,9 +252,7 @@ def test_generate(openai_collection: OpenAICollection) -> None:
288252

289253

290254
def test_batch_add(collection_factory: CollectionFactory) -> None:
291-
collection = collection_factory("dummy")
292-
if collection._connection._weaviate_version.is_lower_than(1, 24, 0):
293-
pytest.skip("Named vectors are not supported in versions lower than 1.24.0")
255+
294256
collection = collection_factory(
295257
properties=[
296258
wvc.config.Property(name="title", data_type=wvc.config.DataType.TEXT),
@@ -318,9 +280,7 @@ def test_batch_add(collection_factory: CollectionFactory) -> None:
318280

319281

320282
def test_named_vector_with_index_config(collection_factory: CollectionFactory) -> None:
321-
collection = collection_factory("dummy")
322-
if collection._connection._weaviate_version.is_lower_than(1, 24, 0):
323-
pytest.skip("Named vectors are not supported in versions lower than 1.24.0")
283+
324284
collection = collection_factory(
325285
properties=[
326286
wvc.config.Property(name="title", data_type=wvc.config.DataType.TEXT),
@@ -375,9 +335,7 @@ def test_named_vector_with_index_config(collection_factory: CollectionFactory) -
375335

376336

377337
def test_aggregation(collection_factory: CollectionFactory) -> None:
378-
collection = collection_factory("dummy")
379-
if collection._connection._weaviate_version.is_lower_than(1, 24, 0):
380-
pytest.skip("Named vectors are not supported in versions lower than 1.24.0")
338+
381339
collection = collection_factory(
382340
properties=[
383341
wvc.config.Property(name="first", data_type=wvc.config.DataType.TEXT),
@@ -453,9 +411,7 @@ def test_aggregation(collection_factory: CollectionFactory) -> None:
453411
def test_update_to_enable_quantizer_on_specific_named_vector(
454412
collection_factory: CollectionFactory,
455413
) -> None:
456-
collection = collection_factory("dummy")
457-
if collection._connection._weaviate_version.is_lower_than(1, 24, 0):
458-
pytest.skip("Named vectors are not supported in versions lower than 1.24.0")
414+
459415
collection = collection_factory(
460416
properties=[
461417
wvc.config.Property(name="first", data_type=wvc.config.DataType.TEXT),
@@ -548,9 +504,7 @@ def test_update_to_enable_quantizer_on_specific_named_vector(
548504

549505

550506
def test_duplicate_named_vectors(collection_factory: CollectionFactory) -> None:
551-
collection = collection_factory("dummy")
552-
if collection._connection._weaviate_version.is_lower_than(1, 24, 0):
553-
pytest.skip("Named vectors are not supported in versions lower than 1.24.0")
507+
554508
with pytest.raises(WeaviateInvalidInputError) as e:
555509
collection_factory(
556510
vectorizer_config=[

0 commit comments

Comments
 (0)