diff --git a/integration/test_backup_v4.py b/integration/test_backup_v4.py index cee570821..58eae1a03 100644 --- a/integration/test_backup_v4.py +++ b/integration/test_backup_v4.py @@ -16,7 +16,6 @@ ) from weaviate.collections.classes.config import DataType, Property, ReferenceProperty from weaviate.exceptions import ( - WeaviateUnsupportedFeatureError, UnexpectedStatusCodeException, BackupFailedException, ) @@ -455,37 +454,6 @@ def test_backup_and_restore_with_collection_and_config_1_24_x( assert restore_status.status == BackupStatus.SUCCESS -def test_backup_and_restore_with_collection_and_config_1_23_x( - client: weaviate.WeaviateClient, -) -> None: - if client._connection._weaviate_version.is_at_least(1, 24, 0): - pytest.skip("Backup config is supported from Weaviate 1.24.0") - - backup_id = _create_backup_id() - - article = client.collections.use("Article") - - with pytest.raises(WeaviateUnsupportedFeatureError): - article.backup.create( - backup_id=backup_id, - backend=BACKEND, - wait_for_completion=True, - config=BackupConfigCreate( - cpu_percentage=60, - chunk_size=256, - compression_level=BackupCompressionLevel.BEST_SPEED, - ), - ) - - with pytest.raises(WeaviateUnsupportedFeatureError): - article.backup.restore( - backup_id=backup_id, - backend=BACKEND, - wait_for_completion=True, - config=BackupConfigRestore(cpu_percentage=70), - ) - - # did not make it into 1.27, will come later # def test_list_backup(client: weaviate.WeaviateClient) -> None: # """Create and restore backup without waiting.""" diff --git a/integration/test_client.py b/integration/test_client.py index 1c991fb27..b7eb17d42 100644 --- a/integration/test_client.py +++ b/integration/test_client.py @@ -282,9 +282,6 @@ def test_create_export_and_recreate(client: weaviate.WeaviateClient, request: Su def test_create_export_and_recreate_named_vectors( client: weaviate.WeaviateClient, request: SubRequest ) -> None: - if client._connection._weaviate_version.is_lower_than(1, 24, 0): - pytest.skip("Named vectors are not supported in versions lower than 1.24.0") - name1 = request.node.name name2 = request.node.name + "2" client.collections.delete([name1, name2]) @@ -352,10 +349,7 @@ def test_client_cluster_with_lazy_shard_loading( assert nodes[0].shards[0].vector_indexing_status == "READY" assert nodes[0].shards[0].vector_queue_length == 0 assert nodes[0].shards[0].compressed is False - if collection._connection._weaviate_version.is_lower_than(1, 24, 0): - assert nodes[0].shards[0].loaded is None - else: - assert nodes[0].shards[0].loaded is True + assert nodes[0].shards[0].loaded is True finally: client.collections.delete(request.node.name) @@ -377,9 +371,7 @@ def test_client_cluster_without_lazy_shard_loading( assert nodes[0].shards[0].vector_indexing_status == "READY" assert nodes[0].shards[0].vector_queue_length == 0 assert nodes[0].shards[0].compressed is False - if collection._connection._weaviate_version.is_lower_than(1, 24, 0): - assert nodes[0].shards[0].loaded is None - elif collection._connection._weaviate_version.is_lower_than(1, 25, 0): + if collection._connection._weaviate_version.is_lower_than(1, 25, 0): assert nodes[0].shards[0].loaded is True else: assert nodes[0].shards[0].loaded is False diff --git a/integration/test_collection_aggregate.py b/integration/test_collection_aggregate.py index bee532e2a..e1fade0be 100644 --- a/integration/test_collection_aggregate.py +++ b/integration/test_collection_aggregate.py @@ -386,8 +386,7 @@ def test_hybrid_aggregation_group_by( def test_hybrid_aggregation_group_by_with_named_vectors( collection_factory: CollectionFactory, group_by: Union[str, GroupByAggregate] ) -> None: - dummy = collection_factory("dummy") - collection_maker = lambda: collection_factory( + collection = collection_factory( properties=[Property(name="text", data_type=DataType.TEXT)], vectorizer_config=[ Configure.NamedVectors.text2vec_contextionary( @@ -395,12 +394,7 @@ def test_hybrid_aggregation_group_by_with_named_vectors( ) ], ) - if dummy._connection._weaviate_version.is_lower_than(1, 24, 0): - with pytest.raises(WeaviateInvalidInputError): - collection_maker() - return - collection = collection_maker() text_1 = "some text" text_2 = "nothing like the other one at all, not even a little bit" collection.data.insert({"text": text_1}) @@ -415,7 +409,7 @@ def test_hybrid_aggregation_group_by_with_named_vectors( object_limit=2, # has no effect due to alpha=0 target_vector="all", ) - if dummy._connection._weaviate_version.is_lower_than(1, 25, 0): + if collection._connection._weaviate_version.is_lower_than(1, 25, 0): with pytest.raises(WeaviateUnsupportedFeatureError): querier() return diff --git a/integration/test_collection_config.py b/integration/test_collection_config.py index a368e8c0a..23e92d596 100644 --- a/integration/test_collection_config.py +++ b/integration/test_collection_config.py @@ -575,10 +575,6 @@ def test_collection_config_update(collection_factory: CollectionFactory) -> None def test_hnsw_with_bq(collection_factory: CollectionFactory) -> None: - dummy = collection_factory("dummy") - if dummy._connection._weaviate_version.is_lower_than(1, 24, 0): - pytest.skip("BQ+HNSW is not supported in Weaviate versions lower than 1.24.0") - collection = collection_factory( vector_index_config=Configure.VectorIndex.hnsw( vector_cache_max_objects=5, @@ -1199,10 +1195,6 @@ def test_create_custom_vectorizer(collection_factory: CollectionFactory) -> None def test_create_custom_vectorizer_named(collection_factory: CollectionFactory) -> None: - collection_dummy = collection_factory("dummy") - if collection_dummy._connection._weaviate_version.is_lower_than(1, 24, 0): - pytest.skip("Named index is not supported in Weaviate versions lower than 1.24.0") - collection = collection_factory( properties=[Property(name="text", data_type=DataType.TEXT)], vectorizer_config=[ diff --git a/integration/test_collection_hybrid.py b/integration/test_collection_hybrid.py index 6c65ce7df..b799fc9c2 100644 --- a/integration/test_collection_hybrid.py +++ b/integration/test_collection_hybrid.py @@ -22,7 +22,6 @@ ) from weaviate.collections.classes.internal import Object from weaviate.exceptions import ( - WeaviateInvalidInputError, WeaviateUnsupportedFeatureError, ) @@ -215,8 +214,7 @@ def test_hybrid_near_vector_search(collection_factory: CollectionFactory) -> Non def test_hybrid_near_vector_search_named_vectors(collection_factory: CollectionFactory) -> None: - dummy = collection_factory("dummy") - collection_maker = lambda: collection_factory( + collection = collection_factory( properties=[ Property(name="text", data_type=DataType.TEXT), Property(name="int", data_type=DataType.INT), @@ -231,12 +229,6 @@ def test_hybrid_near_vector_search_named_vectors(collection_factory: CollectionF ], ) - if dummy._connection._weaviate_version.is_lower_than(1, 24, 0): - with pytest.raises(WeaviateInvalidInputError): - collection_maker() - return - - collection = collection_maker() uuid_banana = collection.data.insert({"text": "banana"}) collection.data.insert({"text": "dog"}) collection.data.insert({"text": "different concept"}) @@ -325,8 +317,7 @@ def test_hybrid_near_text_search(collection_factory: CollectionFactory) -> None: def test_hybrid_near_text_search_named_vectors(collection_factory: CollectionFactory) -> None: - dummy = collection_factory("dummy") - collection_maker = lambda: collection_factory( + collection = collection_factory( properties=[ Property(name="text", data_type=DataType.TEXT), Property(name="int", data_type=DataType.INT), @@ -340,12 +331,7 @@ def test_hybrid_near_text_search_named_vectors(collection_factory: CollectionFac ), ], ) - if dummy._connection._weaviate_version.is_lower_than(1, 24, 0): - with pytest.raises(WeaviateInvalidInputError): - collection_maker() - return - collection = collection_maker() uuid_banana_pudding = collection.data.insert({"text": "banana pudding"}) collection.data.insert({"text": "banana smoothie"}) collection.data.insert({"text": "different concept"}) diff --git a/integration/test_named_vectors.py b/integration/test_named_vectors.py index 506ca6744..b60f4354a 100644 --- a/integration/test_named_vectors.py +++ b/integration/test_named_vectors.py @@ -21,30 +21,6 @@ from weaviate.types import INCLUDE_VECTOR -def test_create_named_vectors_throws_error_in_old_version( - collection_factory: CollectionFactory, -) -> None: - collection = collection_factory("dummy") - if not collection._connection._weaviate_version.is_lower_than(1, 24, 0): - pytest.skip("Named vectors are supported in versions higher than 1.24.0") - - with pytest.raises(WeaviateInvalidInputError): - collection_factory( - properties=[ - wvc.config.Property(name="title", data_type=wvc.config.DataType.TEXT), - wvc.config.Property(name="content", data_type=wvc.config.DataType.TEXT), - ], - vectorizer_config=[ - wvc.config.Configure.NamedVectors.text2vec_contextionary( - "title", source_properties=["title"], vectorize_collection_name=False - ), - wvc.config.Configure.NamedVectors.text2vec_contextionary( - name="content", source_properties=["content"], vectorize_collection_name=False - ), - ], - ) - - @pytest.mark.parametrize( "include_vector", [["title", "content", "All", "AllExplicit", "bringYourOwn", "bringYourOwn2"], True], @@ -52,9 +28,7 @@ def test_create_named_vectors_throws_error_in_old_version( def test_create_named_vectors( collection_factory: CollectionFactory, include_vector: Union[List[str], bool] ) -> None: - collection = collection_factory("dummy") - if collection._connection._weaviate_version.is_lower_than(1, 24, 0): - pytest.skip("Named vectors are not supported in versions lower than 1.24.0") + collection = collection_factory( properties=[ wvc.config.Property(name="title", data_type=wvc.config.DataType.TEXT), @@ -107,9 +81,7 @@ def test_create_named_vectors( def test_insert_many_add(collection_factory: CollectionFactory) -> None: - collection = collection_factory("dummy") - if collection._connection._weaviate_version.is_lower_than(1, 24, 0): - pytest.skip("Named vectors are not supported in versions lower than 1.24.0") + collection = collection_factory( properties=[ wvc.config.Property(name="title", data_type=wvc.config.DataType.TEXT), @@ -139,9 +111,6 @@ def test_insert_many_add(collection_factory: CollectionFactory) -> None: def test_update(collection_factory: CollectionFactory) -> None: - collection = collection_factory("dummy") - if collection._connection._weaviate_version.is_lower_than(1, 24, 0): - pytest.skip("Named vectors are not supported in versions lower than 1.24.0") collection = collection_factory( properties=[ @@ -174,9 +143,6 @@ def test_update(collection_factory: CollectionFactory) -> None: def test_replace(collection_factory: CollectionFactory) -> None: - collection = collection_factory("dummy") - if collection._connection._weaviate_version.is_lower_than(1, 24, 0): - pytest.skip("Named vectors are not supported in versions lower than 1.24.0") collection = collection_factory( properties=[ @@ -210,9 +176,7 @@ def test_replace(collection_factory: CollectionFactory) -> None: def test_query(collection_factory: CollectionFactory) -> None: - collection = collection_factory("dummy") - if collection._connection._weaviate_version.is_lower_than(1, 24, 0): - pytest.skip("Named vectors are not supported in versions lower than 1.24.0") + collection = collection_factory( properties=[ wvc.config.Property(name="title", data_type=wvc.config.DataType.TEXT), @@ -288,9 +252,7 @@ def test_generate(openai_collection: OpenAICollection) -> None: def test_batch_add(collection_factory: CollectionFactory) -> None: - collection = collection_factory("dummy") - if collection._connection._weaviate_version.is_lower_than(1, 24, 0): - pytest.skip("Named vectors are not supported in versions lower than 1.24.0") + collection = collection_factory( properties=[ wvc.config.Property(name="title", data_type=wvc.config.DataType.TEXT), @@ -318,9 +280,7 @@ def test_batch_add(collection_factory: CollectionFactory) -> None: def test_named_vector_with_index_config(collection_factory: CollectionFactory) -> None: - collection = collection_factory("dummy") - if collection._connection._weaviate_version.is_lower_than(1, 24, 0): - pytest.skip("Named vectors are not supported in versions lower than 1.24.0") + collection = collection_factory( properties=[ 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) - def test_aggregation(collection_factory: CollectionFactory) -> None: - collection = collection_factory("dummy") - if collection._connection._weaviate_version.is_lower_than(1, 24, 0): - pytest.skip("Named vectors are not supported in versions lower than 1.24.0") + collection = collection_factory( properties=[ wvc.config.Property(name="first", data_type=wvc.config.DataType.TEXT), @@ -453,9 +411,7 @@ def test_aggregation(collection_factory: CollectionFactory) -> None: def test_update_to_enable_quantizer_on_specific_named_vector( collection_factory: CollectionFactory, ) -> None: - collection = collection_factory("dummy") - if collection._connection._weaviate_version.is_lower_than(1, 24, 0): - pytest.skip("Named vectors are not supported in versions lower than 1.24.0") + collection = collection_factory( properties=[ 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( def test_duplicate_named_vectors(collection_factory: CollectionFactory) -> None: - collection = collection_factory("dummy") - if collection._connection._weaviate_version.is_lower_than(1, 24, 0): - pytest.skip("Named vectors are not supported in versions lower than 1.24.0") + with pytest.raises(WeaviateInvalidInputError) as e: collection_factory( vectorizer_config=[