Skip to content

Commit e006ed4

Browse files
authored
Merge branch 'main' into dependabot/pip/pytest-asyncio-1.3.0
2 parents 782f1c5 + ee36ac0 commit e006ed4

30 files changed

Lines changed: 1259 additions & 202 deletions

.github/workflows/main.yaml

Lines changed: 17 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,12 @@ env:
2121
WEAVIATE_127: 1.27.27
2222
WEAVIATE_128: 1.28.16
2323
WEAVIATE_129: 1.29.11
24-
WEAVIATE_130: 1.30.21
25-
WEAVIATE_131: 1.31.19
26-
WEAVIATE_132: 1.32.16
27-
WEAVIATE_133: 1.33.4
28-
WEAVIATE_134: 1.34.0
24+
WEAVIATE_130: 1.30.22
25+
WEAVIATE_131: 1.31.20
26+
WEAVIATE_132: 1.32.23
27+
WEAVIATE_133: 1.33.10
28+
WEAVIATE_134: 1.34.5
29+
WEAVIATE_135: 1.35.0
2930

3031
jobs:
3132
lint-and-format:
@@ -59,7 +60,7 @@ jobs:
5960
strategy:
6061
fail-fast: false
6162
matrix:
62-
version: ["3.9", "3.10", "3.11", "3.12", "3.13"]
63+
version: ["3.10", "3.11", "3.12", "3.13", "3.14"]
6364
folder: ["weaviate", "integration", "integration_embedded"]
6465
steps:
6566
- uses: actions/checkout@v4
@@ -79,7 +80,7 @@ jobs:
7980
strategy:
8081
fail-fast: false
8182
matrix:
82-
version: ["3.9", "3.10", "3.11", "3.12", "3.13"]
83+
version: ["3.10", "3.11", "3.12", "3.13", "3.14"]
8384
folder: ["test", "mock_tests"]
8485
steps:
8586
- uses: actions/checkout@v4
@@ -122,7 +123,7 @@ jobs:
122123
runs-on: ubuntu-latest
123124
strategy:
124125
matrix:
125-
version: ["3.9", "3.10", "3.11", "3.12", "3.13"]
126+
version: ["3.10", "3.11", "3.12", "3.13", "3.14"]
126127
optional_dependencies: [false]
127128
steps:
128129
- uses: actions/checkout@v4
@@ -153,11 +154,11 @@ jobs:
153154
fail-fast: false
154155
matrix:
155156
versions: [
156-
{ py: "3.9", weaviate: $WEAVIATE_132, grpc: "1.59.0"},
157-
{ py: "3.10", weaviate: $WEAVIATE_132, grpc: "1.66.0"},
158-
{ py: "3.11", weaviate: $WEAVIATE_132, grpc: "1.70.0"},
159-
{ py: "3.12", weaviate: $WEAVIATE_132, grpc: "1.72.1"},
160-
{ py: "3.13", weaviate: $WEAVIATE_132, grpc: "1.74.0"}
157+
{ py: "3.10", weaviate: $WEAVIATE_132, grpc: "1.59.0"},
158+
{ py: "3.11", weaviate: $WEAVIATE_132, grpc: "1.66.0"},
159+
{ py: "3.12", weaviate: $WEAVIATE_132, grpc: "1.70.0"},
160+
{ py: "3.13", weaviate: $WEAVIATE_132, grpc: "1.72.1"},
161+
{ py: "3.14", weaviate: $WEAVIATE_132, grpc: "1.76.0"}
161162
]
162163
optional_dependencies: [false]
163164
steps:
@@ -208,11 +209,11 @@ jobs:
208209
fail-fast: false
209210
matrix:
210211
versions: [
211-
{ py: "3.9", weaviate: $WEAVIATE_132},
212212
{ py: "3.10", weaviate: $WEAVIATE_132},
213213
{ py: "3.11", weaviate: $WEAVIATE_132},
214214
{ py: "3.12", weaviate: $WEAVIATE_132},
215-
{ py: "3.13", weaviate: $WEAVIATE_132}
215+
{ py: "3.13", weaviate: $WEAVIATE_132},
216+
{ py: "3.14", weaviate: $WEAVIATE_132}
216217
]
217218
optional_dependencies: [false]
218219
steps:
@@ -305,6 +306,7 @@ jobs:
305306
$WEAVIATE_132,
306307
$WEAVIATE_133,
307308
$WEAVIATE_134
309+
$WEAVIATE_135
308310
]
309311
steps:
310312
- name: Checkout

.pre-commit-config.yaml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ repos:
99

1010
- repo: https://github.com/astral-sh/ruff-pre-commit
1111
# Ruff version.
12-
rev: v0.11.7
12+
rev: v0.14.7
1313
hooks:
1414
# Run the linter.
1515
- id: ruff
@@ -19,24 +19,24 @@ repos:
1919
args: [ weaviate, integration, test, mock_tests, journey_tests ]
2020

2121
- repo: https://github.com/PyCQA/flake8
22-
rev: 7.1.0
22+
rev: 7.3.0
2323
hooks:
2424
- id: flake8
2525
name: linting
2626
additional_dependencies: [
27-
'flake8-bugbear==22.10.27',
28-
'flake8-comprehensions==3.10.1',
29-
'flake8-builtins==2.0.1'
27+
'flake8-bugbear==24.12.12',
28+
'flake8-comprehensions==3.17.0',
29+
'flake8-builtins==3.0.0'
3030
]
3131
- id: flake8
3232
name: docstrings
3333
additional_dependencies: [
3434
'flake8-docstrings==1.7.0',
35-
'pydoclint==0.6.5',
35+
'pydoclint==0.7.3',
3636
]
3737

3838
- repo: https://github.com/pre-commit/pre-commit-hooks
39-
rev: v4.6.0
39+
rev: v6.0.0
4040
hooks:
4141
- id: no-commit-to-branch
4242
- id: trailing-whitespace

ci/docker-compose-backup.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,8 @@ services:
3030
AUTHORIZATION_ENABLE_RBAC: "true"
3131
AUTHENTICATION_DB_USERS_ENABLED: "true"
3232
AUTHENTICATION_OIDC_ENABLED: 'true'
33-
AUTHENTICATION_OIDC_CLIENT_ID: 'wcs'
34-
AUTHENTICATION_OIDC_ISSUER: 'https://auth.wcs.api.weaviate.io/auth/realms/SeMI'
33+
AUTHENTICATION_OIDC_CLIENT_ID: 'Peuc12y02UA0eAED1dqSjE5HtGUrpBsx'
34+
AUTHENTICATION_OIDC_ISSUER: 'https://auth.weaviate.cloud/Peuc12y02UA0eAED1dqSjE5HtGUrpBsx'
3535
AUTHENTICATION_OIDC_USERNAME_CLAIM: 'email'
36-
AUTHENTICATION_OIDC_GROUPS_CLAIM: 'groups'
36+
AUTHENTICATION_OIDC_GROUPS_CLAIM: 'roles'
3737
...

ci/docker-compose-rbac.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,8 @@ services:
2929
AUTHORIZATION_ENABLE_RBAC: "true"
3030
AUTHENTICATION_DB_USERS_ENABLED: "true"
3131
AUTHENTICATION_OIDC_ENABLED: 'true'
32-
AUTHENTICATION_OIDC_CLIENT_ID: 'wcs'
33-
AUTHENTICATION_OIDC_ISSUER: 'https://auth.wcs.api.weaviate.io/auth/realms/SeMI'
32+
AUTHENTICATION_OIDC_CLIENT_ID: 'Peuc12y02UA0eAED1dqSjE5HtGUrpBsx'
33+
AUTHENTICATION_OIDC_ISSUER: 'https://auth.weaviate.cloud/Peuc12y02UA0eAED1dqSjE5HtGUrpBsx'
3434
AUTHENTICATION_OIDC_USERNAME_CLAIM: 'email'
35-
AUTHENTICATION_OIDC_GROUPS_CLAIM: 'groups'
35+
AUTHENTICATION_OIDC_GROUPS_CLAIM: 'roles'
3636
...

docs/changelog.rst

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,26 @@
11
Changelog
22
=========
33

4+
Version 4.19.0
5+
--------------
6+
This minor version includes:
7+
- Support for new 1.35 features:
8+
- Add support for time-to-live (TTL) on objects
9+
- Add support for new ``multi2multivec-weaviate`` module
10+
- Enhance model integration helper functions
11+
- Add separate service-specific helpers for aws sagemaker vs bedrock, or google gemini vs vertex
12+
- Add BaseURL support for Cohere rerankers
13+
- Fix model provider parameters
14+
- Improve batch performance by optimizing checks for live threads
15+
- Update authlib
16+
17+
18+
Version 4.18.3
19+
--------------
20+
This patch version includes:
21+
- Fixes wrong deprecation warning in PyCharm when creating a collection without vectorizers
22+
- Fixes warnings with boolean filters
23+
424
Version 4.18.2
525
--------------
626
This patch version includes:

integration/conftest.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import os
2+
import time
23
from typing import (
34
Any,
45
AsyncGenerator,
@@ -11,16 +12,16 @@
1112
Type,
1213
Union,
1314
)
15+
from typing import Callable, TypeVar
1416

1517
import pytest
1618
import pytest_asyncio
1719
from _pytest.fixtures import SubRequest
18-
import time
19-
from typing import Callable, TypeVar
2020

2121
import weaviate
2222
from weaviate.collections import Collection, CollectionAsync
2323
from weaviate.collections.classes.config import (
24+
_ObjectTTLConfigCreate,
2425
Configure,
2526
DataType,
2627
Property,
@@ -37,7 +38,6 @@
3738
from weaviate.collections.classes.config_named_vectors import _NamedVectorConfigCreate
3839
from weaviate.collections.classes.types import Properties
3940
from weaviate.config import AdditionalConfig
40-
4141
from weaviate.exceptions import UnexpectedStatusCodeError
4242

4343

@@ -66,6 +66,7 @@ def __call__(
6666
vector_config: Optional[
6767
Optional[Union[_VectorConfigCreate, List[_VectorConfigCreate]]]
6868
] = None,
69+
object_ttl: Optional[_ObjectTTLConfigCreate] = None,
6970
) -> Collection[Any, Any]:
7071
"""Typing for fixture."""
7172
...
@@ -140,6 +141,7 @@ def _factory(
140141
vector_config: Optional[
141142
Optional[Union[_VectorConfigCreate, List[_VectorConfigCreate]]]
142143
] = None,
144+
object_ttl: Optional[_ObjectTTLConfigCreate] = None,
143145
) -> Collection[Any, Any]:
144146
try:
145147
nonlocal client_fixture, name_fixtures, call_counter # noqa: F824
@@ -172,6 +174,7 @@ def _factory(
172174
vector_index_config=vector_index_config,
173175
reranker_config=reranker_config,
174176
vector_config=vector_config,
177+
object_ttl_config=object_ttl,
175178
)
176179
return collection
177180
except Exception as e:

integration/test_client.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -271,7 +271,7 @@ def test_create_export_and_recreate(client: weaviate.WeaviateClient, request: Su
271271
assert export.generative_config is not None
272272
assert export.generative_config.generative == GenerativeSearches.COHERE
273273
assert export.generative_config.model["model"] == "command-r-plus"
274-
assert export.generative_config.model["kProperty"] == 10
274+
assert export.generative_config.model["k"] == 10
275275

276276
client.collections.delete([name1, name2])
277277
assert not client.collections.exists(name1)

integration/test_collection_config.py

Lines changed: 121 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import datetime
12
from typing import Generator, List, Optional, Union
23

34
import pytest as pytest
@@ -913,9 +914,11 @@ def test_config_vector_index_hnsw_and_quantizer_pq(collection_factory: Collectio
913914
[
914915
(Configure.Reranker.cohere(), Rerankers.COHERE, {}),
915916
(
916-
Configure.Reranker.cohere(model="rerank-english-v2.0"),
917+
Configure.Reranker.cohere(
918+
model="rerank-english-v2.0", base_url="https://some-cohere-baseurl.ai/"
919+
),
917920
Rerankers.COHERE,
918-
{"model": "rerank-english-v2.0"},
921+
{"model": "rerank-english-v2.0", "baseURL": "https://some-cohere-baseurl.ai/"},
919922
),
920923
(Configure.Reranker.transformers(), Rerankers.TRANSFORMERS, {}),
921924
],
@@ -1831,3 +1834,119 @@ def test_uncompressed_quantitizer(collection_factory: CollectionFactory) -> None
18311834
assert config.vector_index_config is not None
18321835
assert isinstance(config.vector_index_config, _VectorIndexConfigHNSW)
18331836
assert config.vector_index_config.quantizer is None
1837+
1838+
1839+
def test_object_ttl_creation(collection_factory: CollectionFactory) -> None:
1840+
dummy = collection_factory("dummy")
1841+
if dummy._connection._weaviate_version.is_lower_than(1, 35, 0):
1842+
pytest.skip("object ttl is not supported in Weaviate versions lower than 1.35.0")
1843+
1844+
collection = collection_factory(
1845+
object_ttl=Configure.ObjectTTL.delete_by_creation_time(
1846+
time_to_live=datetime.timedelta(days=30),
1847+
filter_expired_objects=True,
1848+
),
1849+
inverted_index_config=Configure.inverted_index(index_timestamps=True),
1850+
)
1851+
1852+
config = collection.config.get()
1853+
assert config.object_ttl_config is not None
1854+
assert config.object_ttl_config.delete_on == "creationTime"
1855+
assert config.object_ttl_config.time_to_live == datetime.timedelta(days=30)
1856+
1857+
1858+
def test_object_ttl_update_time(collection_factory: CollectionFactory) -> None:
1859+
dummy = collection_factory("dummy")
1860+
if dummy._connection._weaviate_version.is_lower_than(1, 35, 0):
1861+
pytest.skip("object ttl is not supported in Weaviate versions lower than 1.35.0")
1862+
1863+
collection = collection_factory(
1864+
object_ttl=Configure.ObjectTTL.delete_by_update_time(
1865+
time_to_live=datetime.timedelta(days=30),
1866+
filter_expired_objects=True,
1867+
),
1868+
inverted_index_config=Configure.inverted_index(index_timestamps=True),
1869+
)
1870+
1871+
config = collection.config.get()
1872+
assert config.object_ttl_config is not None
1873+
assert config.object_ttl_config.delete_on == "updateTime"
1874+
assert config.object_ttl_config.filter_expired_objects
1875+
assert config.object_ttl_config.time_to_live == datetime.timedelta(days=30)
1876+
1877+
1878+
def test_object_ttl_custom(collection_factory: CollectionFactory) -> None:
1879+
dummy = collection_factory("dummy")
1880+
if dummy._connection._weaviate_version.is_lower_than(1, 35, 0):
1881+
pytest.skip("object ttl is not supported in Weaviate versions lower than 1.35.0")
1882+
1883+
collection = collection_factory(
1884+
properties=[wvc.config.Property(name="customDate", data_type=DataType.DATE)],
1885+
object_ttl=Configure.ObjectTTL.delete_by_date_property(
1886+
property_name="customDate", filter_expired_objects=False, ttl_offset=-1
1887+
),
1888+
inverted_index_config=Configure.inverted_index(index_timestamps=True),
1889+
)
1890+
1891+
config = collection.config.get()
1892+
assert config.object_ttl_config is not None
1893+
assert config.object_ttl_config.delete_on == "customDate"
1894+
assert config.object_ttl_config.time_to_live == datetime.timedelta(seconds=-1)
1895+
assert not config.object_ttl_config.filter_expired_objects
1896+
1897+
1898+
def test_object_ttl_update(collection_factory: CollectionFactory) -> None:
1899+
dummy = collection_factory("dummy")
1900+
if dummy._connection._weaviate_version.is_lower_than(1, 35, 0):
1901+
pytest.skip("object ttl is not supported in Weaviate versions lower than 1.35.0")
1902+
1903+
collection = collection_factory(
1904+
properties=[
1905+
wvc.config.Property(name="customDate", data_type=DataType.DATE),
1906+
wvc.config.Property(name="customDate2", data_type=DataType.DATE),
1907+
],
1908+
inverted_index_config=Configure.inverted_index(index_timestamps=True),
1909+
)
1910+
1911+
conf = collection.config.get()
1912+
assert conf.object_ttl_config is None
1913+
1914+
collection.config.update(
1915+
object_ttl_config=Reconfigure.ObjectTTL.delete_by_date_property(
1916+
property_name="customDate", filter_expired_objects=True, ttl_offset=3600
1917+
),
1918+
)
1919+
1920+
conf = collection.config.get()
1921+
assert conf.object_ttl_config is not None
1922+
assert conf.object_ttl_config.delete_on == "customDate"
1923+
assert conf.object_ttl_config.time_to_live == datetime.timedelta(seconds=3600)
1924+
assert conf.object_ttl_config.filter_expired_objects
1925+
1926+
collection.config.update(
1927+
object_ttl_config=Reconfigure.ObjectTTL.delete_by_update_time(filter_expired_objects=False),
1928+
)
1929+
1930+
conf = collection.config.get()
1931+
assert conf.object_ttl_config is not None
1932+
assert conf.object_ttl_config.delete_on == "updateTime"
1933+
assert conf.object_ttl_config.time_to_live == datetime.timedelta(seconds=3600)
1934+
assert not conf.object_ttl_config.filter_expired_objects
1935+
1936+
collection.config.update(
1937+
object_ttl_config=Reconfigure.ObjectTTL.delete_by_creation_time(
1938+
time_to_live=datetime.timedelta(seconds=600),
1939+
),
1940+
)
1941+
1942+
conf = collection.config.get()
1943+
assert conf.object_ttl_config is not None
1944+
assert conf.object_ttl_config.delete_on == "creationTime"
1945+
assert conf.object_ttl_config.time_to_live == datetime.timedelta(seconds=600)
1946+
assert not conf.object_ttl_config.filter_expired_objects
1947+
1948+
collection.config.update(
1949+
object_ttl_config=Reconfigure.ObjectTTL.disable(),
1950+
)
1951+
conf = collection.config.get()
1952+
assert conf.object_ttl_config is None

0 commit comments

Comments
 (0)