Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dev/1.29 #1524

Draft
wants to merge 58 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
58 commits
Select commit Hold shift + click to select a range
9318464
Add logic to deser/ser multi-vecs from/into vector_bytes in BatchObje…
tsmith023 Jan 22, 2025
6f1d4ad
Rearrange packing logic for better readability and generality
tsmith023 Jan 23, 2025
070889d
Import `cast` from `typing_extensions` for `3.9`
tsmith023 Jan 23, 2025
45a2539
Fix `3.9` type issue
tsmith023 Jan 23, 2025
fac3c5e
Fix usage of `_ManyVectorsQuery` for 1.27/1.28
tsmith023 Jan 23, 2025
2d219f4
Fix flakey periodic token refresh failures
tsmith023 Jan 23, 2025
c721062
Rename `colbert` to `multivector` in collection config, add `multi_ve…
tsmith023 Jan 23, 2025
0bfdc45
Fix broken mock test
tsmith023 Jan 23, 2025
0f2a9d3
Rename `NearVectorQuery` to `NearVector`
tsmith023 Jan 23, 2025
403b8e3
Respond to review
tsmith023 Jan 23, 2025
66af603
Add initial support for gRPC aggregate method for use in __len__
tsmith023 Jan 24, 2025
59d8609
Add test of hybrid with colbert named vector
tsmith023 Jan 27, 2025
c632284
Update to use latest changes on `main` of core
tsmith023 Jan 27, 2025
285be76
Make `_HybridNearVector` a native class to avoid validation issues wi…
tsmith023 Jan 27, 2025
4d158a8
Align on acceptable UX naming of methods
tsmith023 Jan 28, 2025
6857809
Respond to comment
tsmith023 Jan 28, 2025
5ec9c81
Fix test
tsmith023 Jan 28, 2025
cfb8081
Merge pull request #1521 from weaviate/modules/support-colbert-multi-vec
tsmith023 Jan 28, 2025
a13e6c9
Update to latest `main` image
tsmith023 Jan 28, 2025
cde7f40
Merge branch 'main' of https://github.com/weaviate/weaviate-python-cl…
tsmith023 Jan 28, 2025
11a8cb7
Update to latest protos and add logic to for `over_all` call using grpc
tsmith023 Jan 28, 2025
148ae4e
do we append to tmp on every iteration no matter the type?
Jan 29, 2025
07b537a
Add support for all searches using grpc aggregate
tsmith023 Jan 29, 2025
2a010e1
Amend colbert test to validate fix
tsmith023 Jan 29, 2025
e414c99
Merge pull request #1527 from weaviate/vector-for-target-multidimensi…
tsmith023 Jan 29, 2025
a0aa6d3
Change any reranker tests to exclusively use cohere
tsmith023 Jan 30, 2025
a195750
Merge dev/1.29
tsmith023 Jan 30, 2025
3fa5f02
Merge branch 'dev/1.29' of https://github.com/weaviate/weaviate-pytho…
tsmith023 Jan 30, 2025
7415183
Fix broken unit test
tsmith023 Jan 30, 2025
23aaba7
Actually fix unit test
tsmith023 Jan 30, 2025
d2bdf80
Merge pull request #1529 from weaviate/chore/change-reranker-tests-to…
tsmith023 Jan 30, 2025
5d6f449
Fix logic for BC target vector check in aggregate
tsmith023 Jan 30, 2025
2682472
Fix integration test for previous Weaviate versions
tsmith023 Jan 30, 2025
3cd7698
Make smaller changes in response to review
tsmith023 Jan 31, 2025
9313978
Update to use latest proto
tsmith023 Jan 31, 2025
769a354
Update CI to latest main build
tsmith023 Jan 31, 2025
a7ec88f
Gate aggregate grpc behind `1.29.0` rather than `1.28.4`
tsmith023 Jan 31, 2025
0707594
Update CI to use latest dev image
tsmith023 Feb 3, 2025
efeda9c
Merge pull request #1522 from weaviate/grpc/add-initial-support-for-a…
tsmith023 Feb 3, 2025
410acd3
Merge branch 'main' of https://github.com/weaviate/weaviate-python-cl…
tsmith023 Feb 3, 2025
31aa27e
Merge branch 'main' into dev/1.29
dirkkul Feb 4, 2025
decc7c7
Merge branch 'main' into dev/1.29
dirkkul Feb 4, 2025
b94abbb
Alter passing of near vector args in queries ready for server change
tsmith023 Feb 4, 2025
39af633
Merge branch 'main' into dev/1.29
dirkkul Feb 5, 2025
ce97149
Update CI pipeline images
tsmith023 Feb 6, 2025
cd9593d
Merge branch 'dev/1.29' of https://github.com/weaviate/weaviate-pytho…
tsmith023 Feb 6, 2025
6123c1a
Commit forgotten stashed changes
tsmith023 Feb 6, 2025
ecb193c
Update CI images, adjust logic to handle BC for 1.28/1.29 changes
tsmith023 Feb 6, 2025
1450f59
Update CI, make small fixes
tsmith023 Feb 7, 2025
7a64e40
Fix order of inheritance with pydantic and generics
tsmith023 Feb 7, 2025
44f572c
Remove incorrectly added `uses_127_api=True`
tsmith023 Feb 7, 2025
090138d
Modify parsing to support raw `[[float]]` in `near_vector` again
tsmith023 Feb 7, 2025
4f0e7b0
Add logic to pass simple single/multi vec searches into new Vectors m…
tsmith023 Feb 7, 2025
23e1299
Update CI images, make small changes to fix tests
tsmith023 Feb 7, 2025
9d34726
Fix skip in test
tsmith023 Feb 7, 2025
5105704
Actually fix deprecated test
tsmith023 Feb 7, 2025
2375d2b
Merge pull request #1534 from weaviate/1.29/refactor-near-vector-parsing
tsmith023 Feb 10, 2025
d70e928
Merge branch 'main' of https://github.com/weaviate/weaviate-python-cl…
tsmith023 Feb 11, 2025
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
31 changes: 17 additions & 14 deletions .github/workflows/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ env:
WEAVIATE_126: 1.26.14
WEAVIATE_127: 1.27.12
WEAVIATE_128: stable-v1.28-9075f00
WEAVIATE_129: 1.29.0-rc.1

jobs:
lint-and-format:
Expand Down Expand Up @@ -54,7 +55,7 @@ jobs:
strategy:
fail-fast: false
matrix:
version: ["3.9", "3.10", "3.11", "3.12"]
version: ["3.9", "3.10", "3.11", "3.12", "3.13"]
folder: ["weaviate"]
steps:
- uses: actions/checkout@v4
Expand All @@ -75,7 +76,7 @@ jobs:
strategy:
fail-fast: false
matrix:
version: ["3.9", "3.10", "3.11", "3.12"]
version: ["3.9", "3.10", "3.11", "3.12", "3.13"]
folder: ["test", "mock_tests"]
steps:
- uses: actions/checkout@v4
Expand All @@ -98,7 +99,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
version: ["3.9", "3.10", "3.11", "3.12"]
version: ["3.9", "3.10", "3.11", "3.12", "3.13"]
optional_dependencies: [false]
steps:
- uses: actions/checkout@v4
Expand Down Expand Up @@ -129,11 +130,11 @@ jobs:
fail-fast: false
matrix:
versions: [
{ py: "3.9", weaviate: $WEAVIATE_124},
{ py: "3.10", weaviate: $WEAVIATE_125},
{ py: "3.11", weaviate: $WEAVIATE_126},
{ py: "3.12", weaviate: $WEAVIATE_127},
{ py: "3.13", weaviate: $WEAVIATE_128}
{ py: "3.9", weaviate: $WEAVIATE_129},
{ py: "3.10", weaviate: $WEAVIATE_129},
{ py: "3.11", weaviate: $WEAVIATE_129},
{ py: "3.12", weaviate: $WEAVIATE_129},
{ py: "3.13", weaviate: $WEAVIATE_129}
]
optional_dependencies: [false]
steps:
Expand Down Expand Up @@ -184,11 +185,11 @@ jobs:
fail-fast: false
matrix:
versions: [
{ py: "3.9", weaviate: $WEAVIATE_128},
{ py: "3.10", weaviate: $WEAVIATE_128},
{ py: "3.11", weaviate: $WEAVIATE_128},
{ py: "3.12", weaviate: $WEAVIATE_128},
{ py: "3.13", weaviate: $WEAVIATE_128}
{ py: "3.9", weaviate: $WEAVIATE_129},
{ py: "3.10", weaviate: $WEAVIATE_129},
{ py: "3.11", weaviate: $WEAVIATE_129},
{ py: "3.12", weaviate: $WEAVIATE_129},
{ py: "3.13", weaviate: $WEAVIATE_129}
]
optional_dependencies: [false]
steps:
Expand Down Expand Up @@ -274,10 +275,12 @@ jobs:
fail-fast: false
matrix:
server: [
$WEAVIATE_124,
$WEAVIATE_125,
$WEAVIATE_126,
$WEAVIATE_127,
$WEAVIATE_128
$WEAVIATE_128,
$WEAVIATE_129
]
steps:
- name: Checkout
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
version: '3.4'
services:
weaviate_openai:
weaviate_modules:
command:
- --host
- 0.0.0.0
Expand All @@ -19,6 +19,6 @@ services:
AUTHENTICATION_ANONYMOUS_ACCESS_ENABLED: 'true'
PERSISTENCE_DATA_PATH: '/var/lib/weaviate'
DEFAULT_VECTORIZER_MODULE: 'text2vec-openai'
ENABLE_MODULES: 'text2vec-openai,generative-openai,text2vec-cohere,generative-cohere'
ENABLE_MODULES: 'text2colbert-jinaai,text2vec-openai,generative-openai,text2vec-cohere,generative-cohere,reranker-cohere'
CLUSTER_HOSTNAME: 'node1'
DISABLE_TELEMETRY: 'true'
31 changes: 22 additions & 9 deletions integration/test_collection_aggregate.py
Original file line number Diff line number Diff line change
Expand Up @@ -201,17 +201,24 @@ def test_over_all_with_filters_ref(collection_factory: CollectionFactory) -> Non
assert res.properties["text"].count == 1
assert res.properties["text"].top_occurrences[0].value == "two"

with pytest.raises(WeaviateInvalidInputError):
res = collection.aggregate.over_all(
filters=Filter.by_ref("ref")
.by_property("text")
.equal("one"), # gRPC-compat API not support by GQL aggregation
return_metrics=[Metrics("text").text(count=True, top_occurrences_value=True)],
)
query = lambda: collection.aggregate.over_all(
filters=Filter.by_ref("ref").by_property("text").equal("one"),
return_metrics=[Metrics("text").text(count=True, top_occurrences_value=True)],
)
if collection._connection._weaviate_version.is_lower_than(1, 29, 0):
with pytest.raises(WeaviateInvalidInputError):
query()
else:
res = query()
assert isinstance(res.properties["text"], AggregateText)
assert res.properties["text"].count == 1
assert res.properties["text"].top_occurrences[0].value == "two"


def test_wrong_aggregation(collection_factory: CollectionFactory) -> None:
collection = collection_factory(properties=[Property(name="text", data_type=DataType.TEXT)])
if collection._connection._weaviate_version.is_at_least(1, 29, 0):
pytest.skip("GQL is only used for versions 1.28.4 and lower")
with pytest.raises(WeaviateQueryError) as e:
collection.aggregate.over_all(total_count=False)
assert (
Expand Down Expand Up @@ -658,13 +665,19 @@ def test_group_by_aggregation_argument(collection_factory: CollectionFactory) ->
groups = res.groups
assert len(groups) == 2
assert groups[0].grouped_by.prop == "int"
assert groups[0].grouped_by.value == "1" or groups[1].grouped_by.value == "1"
if collection._connection._weaviate_version.is_lower_than(1, 29, 0):
assert groups[0].grouped_by.value == "1" or groups[1].grouped_by.value == "1"
else:
assert groups[0].grouped_by.value == 1 or groups[1].grouped_by.value == 1
assert isinstance(groups[0].properties["text"], AggregateText)
assert groups[0].properties["text"].count == 1
assert isinstance(groups[0].properties["int"], AggregateInteger)
assert groups[0].properties["int"].count == 1
assert groups[1].grouped_by.prop == "int"
assert groups[1].grouped_by.value == "2" or groups[0].grouped_by.value == "2"
if collection._connection._weaviate_version.is_lower_than(1, 29, 0):
assert groups[1].grouped_by.value == "2" or groups[0].grouped_by.value == "2"
else:
assert groups[1].grouped_by.value == 2 or groups[0].grouped_by.value == 2
assert isinstance(groups[1].properties["text"], AggregateText)
assert groups[1].properties["text"].count == 1
assert isinstance(groups[1].properties["int"], AggregateInteger)
Expand Down
14 changes: 7 additions & 7 deletions integration/test_collection_openai.py
Original file line number Diff line number Diff line change
Expand Up @@ -578,18 +578,18 @@ def test_openai_batch_upload(openai_collection: OpenAICollection, request: SubRe


def test_queries_with_rerank_and_generative(collection_factory: CollectionFactory) -> None:
api_key = os.environ.get("OPENAI_APIKEY")
api_key = os.environ.get("COHERE_APIKEY")
if api_key is None:
pytest.skip("No OpenAI API key found.")
pytest.skip("No Cohere API key found.")

collection = collection_factory(
name="Test_test_queries_with_rerank_and_generative",
generative_config=Configure.Generative.openai(),
reranker_config=Configure.Reranker.transformers(),
vectorizer_config=Configure.Vectorizer.text2vec_openai(),
generative_config=Configure.Generative.cohere(),
reranker_config=Configure.Reranker.cohere(),
vectorizer_config=Configure.Vectorizer.text2vec_cohere(),
properties=[Property(name="text", data_type=DataType.TEXT)],
ports=(8079, 50050),
headers={"X-OpenAI-Api-Key": api_key},
ports=(8086, 50057),
headers={"X-Cohere-Api-Key": api_key},
)
if collection._connection._weaviate_version < _ServerVersion(1, 23, 1):
pytest.skip("Generative reranking requires Weaviate 1.23.1 or higher")
Expand Down
29 changes: 15 additions & 14 deletions integration/test_collection_rerank.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
import pytest

import weaviate.classes as wvc
from weaviate.util import _ServerVersion
from .conftest import CollectionFactory


Expand All @@ -13,7 +12,7 @@ def test_query_using_rerank_with_old_server(collection_factory: CollectionFactor
vectorizer_config=wvc.config.Configure.Vectorizer.none(),
properties=[wvc.config.Property(name="text", data_type=wvc.config.DataType.TEXT)],
)
if collection._connection._weaviate_version >= _ServerVersion(1, 23, 1):
if collection._connection._weaviate_version.is_at_least(1, 23, 1):
pytest.skip("Reranking works with 1.23.1 or higher so no need to test this")

collection.data.insert_many([{"text": "This is a test"}, {"text": "This is another test"}])
Expand All @@ -28,18 +27,19 @@ def test_query_using_rerank_with_old_server(collection_factory: CollectionFactor


def test_queries_with_rerank(collection_factory: CollectionFactory) -> None:
api_key = os.environ.get("OPENAI_APIKEY")
api_key = os.environ.get("COHERE_APIKEY")
if api_key is None:
pytest.skip("No OpenAI API key found.")
pytest.skip("No Cohere API key found.")

collection = collection_factory(
name="Test_test_queries_with_rerank",
reranker_config=wvc.config.Configure.Reranker.custom("reranker-dummy"),
vectorizer_config=wvc.config.Configure.Vectorizer.text2vec_openai(),
reranker_config=wvc.config.Configure.Reranker.cohere(),
vectorizer_config=wvc.config.Configure.Vectorizer.text2vec_cohere(),
properties=[wvc.config.Property(name="text", data_type=wvc.config.DataType.TEXT)],
headers={"X-OpenAI-Api-Key": api_key},
headers={"X-Cohere-Api-Key": api_key},
ports=(8086, 50057),
)
if collection._connection._weaviate_version < _ServerVersion(1, 23, 1):
if collection._connection._weaviate_version.is_lower_than(1, 23, 1):
pytest.skip("Reranking requires Weaviate 1.23.1 or higher")

insert = collection.data.insert_many(
Expand Down Expand Up @@ -83,20 +83,21 @@ def test_queries_with_rerank(collection_factory: CollectionFactory) -> None:


def test_queries_with_rerank_and_group_by(collection_factory: CollectionFactory) -> None:
api_key = os.environ.get("OPENAI_APIKEY")
api_key = os.environ.get("COHERE_APIKEY")
if api_key is None:
pytest.skip("No OpenAI API key found.")
pytest.skip("No Cohere API key found.")

collection = collection_factory(
name="Test_test_queries_with_rerank_and_group_by",
reranker_config=wvc.config.Configure.Reranker.custom("reranker-dummy"),
vectorizer_config=wvc.config.Configure.Vectorizer.text2vec_openai(
reranker_config=wvc.config.Configure.Reranker.cohere(),
vectorizer_config=wvc.config.Configure.Vectorizer.text2vec_cohere(
vectorize_collection_name=False
),
properties=[wvc.config.Property(name="text", data_type=wvc.config.DataType.TEXT)],
headers={"X-OpenAI-Api-Key": api_key},
headers={"X-Cohere-Api-Key": api_key},
ports=(8086, 50057),
)
if collection._connection._weaviate_version < _ServerVersion(1, 23, 1):
if collection._connection._weaviate_version.is_lower_than(1, 23, 1):
pytest.skip("Reranking requires Weaviate 1.23.1 or higher")

insert = collection.data.insert_many(
Expand Down
Loading
Loading