Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 0 additions & 32 deletions integration/test_backup_v4.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
)
from weaviate.collections.classes.config import DataType, Property, ReferenceProperty
from weaviate.exceptions import (
WeaviateUnsupportedFeatureError,
UnexpectedStatusCodeException,
BackupFailedException,
)
Expand Down Expand Up @@ -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."""
Expand Down
12 changes: 2 additions & 10 deletions integration/test_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -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])
Expand Down Expand Up @@ -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)

Expand All @@ -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
Expand Down
10 changes: 2 additions & 8 deletions integration/test_collection_aggregate.py
Original file line number Diff line number Diff line change
Expand Up @@ -386,21 +386,15 @@ 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(
name="all", vectorize_collection_name=False
)
],
)
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})
Expand All @@ -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
Expand Down
8 changes: 0 additions & 8 deletions integration/test_collection_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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=[
Expand Down
18 changes: 2 additions & 16 deletions integration/test_collection_hybrid.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
)
from weaviate.collections.classes.internal import Object
from weaviate.exceptions import (
WeaviateInvalidInputError,
WeaviateUnsupportedFeatureError,
)

Expand Down Expand Up @@ -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),
Expand All @@ -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"})
Expand Down Expand Up @@ -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 = lambda: collection_factory(
properties=[
Property(name="text", data_type=DataType.TEXT),
Property(name="int", data_type=DataType.INT),
Expand All @@ -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"})
Expand Down
62 changes: 8 additions & 54 deletions integration/test_named_vectors.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,40 +21,14 @@
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],
)
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),
Expand Down Expand Up @@ -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),
Expand Down Expand Up @@ -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=[
Expand Down Expand Up @@ -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=[
Expand Down Expand Up @@ -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),
Expand Down Expand Up @@ -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),
Expand Down Expand Up @@ -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),
Expand Down Expand Up @@ -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),
Expand Down Expand Up @@ -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),
Expand Down Expand Up @@ -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=[
Expand Down
Loading