Skip to content

Commit f723d44

Browse files
authored
Merge pull request #1910 from weaviate/dev/1.35
Dev/1.35
2 parents 9e62e72 + 3d20d73 commit f723d44

File tree

18 files changed

+462
-117
lines changed

18 files changed

+462
-117
lines changed

.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

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_collection_config.py

Lines changed: 117 additions & 0 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
@@ -1833,3 +1834,119 @@ def test_uncompressed_quantitizer(collection_factory: CollectionFactory) -> None
18331834
assert config.vector_index_config is not None
18341835
assert isinstance(config.vector_index_config, _VectorIndexConfigHNSW)
18351836
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

mock_tests/test_collection.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,7 @@ def test_missing_multi_tenancy_config(
106106
reranker_config=None,
107107
vectorizer_config=None,
108108
vector_config=None,
109+
object_ttl_config=None,
109110
inverted_index_config=InvertedIndexConfig(
110111
bm25=BM25Config(b=0, k1=0),
111112
cleanup_interval_seconds=0,

requirements-devel.txt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
httpx==0.26.0
22
validators==0.34.0
33
authlib==1.6.5
4-
grpcio==1.66.2
5-
grpcio-tools==1.66.2
6-
grpcio-health-checking==1.66.2
7-
pydantic==2.8.0
4+
grpcio==1.75.1
5+
grpcio-tools==1.75.1
6+
grpcio-health-checking==1.75.1
7+
pydantic==2.12.0
88
deprecation==2.1.0
99

1010
build

setup.cfg

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,12 +36,12 @@ include_package_data = True
3636
install_requires =
3737
httpx>=0.26.0,<0.29.0
3838
validators>=0.34.0,<1.0.0
39-
authlib>=1.2.1,<2.0.0
40-
pydantic>=2.8.0,<3.0.0
39+
authlib>=1.6.5,<2.0.0
40+
pydantic>=2.12.0,<3.0.0
4141
grpcio>=1.59.5,<1.80.0
4242
protobuf>=4.21.6,<7.0.0
4343
deprecation>=2.1.0,<3.0.0
44-
python_requires = >=3.9
44+
python_requires = >=3.10
4545

4646
[options.extras_require]
4747
agents =

0 commit comments

Comments
 (0)