Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
141 commits
Select commit Hold shift + click to select a range
17ba37d
flat index: Add support for RQ and include cache param
rlmanrique Oct 8, 2025
d81781c
Update tests for RQ
rlmanrique Oct 8, 2025
86594fa
Add function to retry if http error
rlmanrique Oct 8, 2025
a1e5aac
Add 1.34 CI and test configuration and move function to conftest
rlmanrique Oct 16, 2025
97a4c21
Update comments
rlmanrique Oct 16, 2025
8558889
Add 134 version
rlmanrique Oct 17, 2025
392aa97
Set 1.34 dev image for CI jobs
rlmanrique Oct 17, 2025
68affd8
Add ACORN as defaul filter strategy in 1.34
rlmanrique Oct 17, 2025
d80c83f
Comment backup test temporarily
rlmanrique Oct 20, 2025
191416e
Merge pull request #1844 from weaviate/rq_flat/cache
dirkkul Oct 20, 2025
d3a8e30
Merge branch 'main' into dev/1.34
dirkkul Oct 31, 2025
8186d11
Introduce `batch.experimental()` while server-side batching is in bet…
tsmith023 Nov 4, 2025
2199790
Ensure created backup in test finishes before starting new test
tsmith023 Nov 4, 2025
dfa3cd3
Use `grpc.aio` and `asyncio.Task` to provide experimental ssb to asyn…
tsmith023 Nov 7, 2025
8957d61
add spfresh to python client
robbespo00 Oct 16, 2025
f1abc27
add enum for centroids index type in spfresh
robbespo00 Oct 17, 2025
9518b8f
Add missing init parameter for spfresh
rlmanrique Nov 17, 2025
896c333
Fix spfresh params in config of the class
rlmanrique Nov 17, 2025
59a1317
Add missing multivector param for spfresh
rlmanrique Nov 17, 2025
f07d50d
Fix multivector
rlmanrique Nov 18, 2025
b245290
Merge branch 'main' of https://github.com/weaviate/weaviate-python-cl…
tsmith023 Nov 18, 2025
a1b4400
Introduce `collection.data.ingest` for sync/async SSB usage
tsmith023 Nov 20, 2025
2bcd33c
Fix update spfresh method
rlmanrique Nov 24, 2025
9e74bb3
Add logic to handle acks msg capping in-flight stream usage
tsmith023 Nov 25, 2025
c188305
remove centroids index type
robbespo00 Nov 28, 2025
49367c4
Align to latest changes with OOM error
tsmith023 Dec 11, 2025
f4e4b8b
Bump batch stream init timeout to 60s from 10s
tsmith023 Dec 12, 2025
ac00a93
Merge branch 'main' of https://github.com/weaviate/weaviate-python-cl…
tsmith023 Dec 15, 2025
fdefaa4
add spfresh to python client
robbespo00 Oct 16, 2025
ffc98b3
add enum for centroids index type in spfresh
robbespo00 Oct 17, 2025
1059b43
Add missing init parameter for spfresh
rlmanrique Nov 17, 2025
2cdc5e8
Fix spfresh params in config of the class
rlmanrique Nov 17, 2025
e8847a8
Add missing multivector param for spfresh
rlmanrique Nov 17, 2025
e735a58
Fix multivector
rlmanrique Nov 18, 2025
88c276c
Fix update spfresh method
rlmanrique Nov 24, 2025
6d6afeb
remove centroids index type
robbespo00 Nov 28, 2025
fb49f84
Rename spfresh to hfresh
rlmanrique Dec 17, 2025
e37ada4
Merge branch 'rob/spfresh' of https://github.com/weaviate/weaviate-py…
robbespo00 Dec 17, 2025
f46fc4a
remove centroids index type
robbespo00 Dec 17, 2025
a56c17f
Fix `Unknown` type in old batch objs/refs
tsmith023 Dec 18, 2025
359830c
Merge branch 'main' into ssb/update-to-1-35-api
tsmith023 Dec 18, 2025
d28b35c
cast AnyUrl to AnyHttpUrl for pyrite
DanielJanicek Dec 30, 2025
d34bb2c
Merge branch 'main' of https://github.com/weaviate/weaviate-python-cl…
tsmith023 Jan 5, 2026
74df2e3
Merge branch 'ssb/update-to-1-35-api' of https://github.com/weaviate/…
tsmith023 Jan 5, 2026
09ab4bb
Merge remote-tracking branch 'origin/main' into rob/spfresh
robbespo00 Jan 13, 2026
545168c
use max posting size kb
robbespo00 Jan 13, 2026
15cb3f2
Merge branch 'main' of https://github.com/weaviate/weaviate-python-cl…
tsmith023 Jan 14, 2026
5879cec
Update CI images
tsmith023 Jan 14, 2026
5e428c5
Ensuire `uuid_lookup` is updated properly on `Acks` msg
tsmith023 Jan 14, 2026
2ae44be
Remove rate limit batch test (too slow)
tsmith023 Jan 14, 2026
4678e8c
Remove creds
tsmith023 Jan 14, 2026
fb9c1e7
Fix uuid lookup in old batching
tsmith023 Jan 14, 2026
b24f14c
Merge remote-tracking branch 'origin/main' into rob/spfresh
robbespo00 Jan 16, 2026
d4baec8
remove rng factor
robbespo00 Jan 16, 2026
bc28ab4
Merge branch 'ssb/update-to-1-35-api' of https://github.com/weaviate/…
tsmith023 Jan 20, 2026
dcf586e
Only test SSB fpr <1.36 vers
tsmith023 Jan 20, 2026
0252f7f
run ruff linter and formatting
robbespo00 Jan 23, 2026
01b3158
add D417
robbespo00 Jan 23, 2026
e4a1273
remove distance metric
robbespo00 Jan 23, 2026
9f6f5c2
Merge remote-tracking branch 'origin/main' into rob/spfresh
robbespo00 Jan 23, 2026
0671036
Merge pull request #1884 from weaviate/ssb/update-to-1-35-api
tsmith023 Jan 26, 2026
fd94fc4
Merge branch 'dev/1.36' of https://github.com/weaviate/weaviate-pytho…
tsmith023 Jan 26, 2026
69fb0f9
Add experimental batching to async collections
tsmith023 Jan 26, 2026
d77e31c
Rename test funcs to avoid naming collisions
tsmith023 Jan 26, 2026
51340b2
Merge branch 'introduce-experimental-batching-to-async-client' of htt…
tsmith023 Jan 27, 2026
3e018e7
Periodically renew streams prior to 180s timeout when running with GC…
tsmith023 Jan 28, 2026
22b5333
Review changes
tsmith023 Jan 28, 2026
59a9c12
Merge pull request #1931 from weaviate/ssb/renew-stream-during-import…
tsmith023 Jan 28, 2026
0d3dda6
Merge branch 'dev/1.36' of https://github.com/weaviate/weaviate-pytho…
tsmith023 Jan 28, 2026
18496b9
Align async/sync impls:
tsmith023 Jan 28, 2026
2598ba2
Add missing `stream.done_writing()` to `__send` task
tsmith023 Jan 28, 2026
2bb2659
Abstract stop logic
tsmith023 Jan 28, 2026
0f05810
Merge branch 'introduce-experimental-batching-to-async-client' of htt…
tsmith023 Jan 28, 2026
99f88ef
Refactor .ingest internals to use public classes/types from batch
tsmith023 Jan 28, 2026
68fb441
Merge branch 'main' into rob/spfresh
rlmanrique Jan 29, 2026
1aa344f
Remove rate limit tests
tsmith023 Jan 29, 2026
e752211
Bump all ver checks for SSB from 1.34 to 1.36
tsmith023 Jan 29, 2026
70db90b
Add back rate limit tests
tsmith023 Jan 29, 2026
0253cd4
Move tests around
tsmith023 Jan 29, 2026
cdddbd4
Revert more changes to reduce diff
tsmith023 Jan 29, 2026
982a332
Change another test to only apply for <1.36
tsmith023 Jan 29, 2026
c54ae73
Tidy up exception handling in sync/async batching
tsmith023 Jan 30, 2026
6f31d1e
Add support for stream timeouts, defaults to `None`
tsmith023 Jan 30, 2026
335de4b
Handle async queue get timeouts properly
tsmith023 Jan 30, 2026
4bbaf35
Merge pull request #1872 from weaviate/introduce-experimental-batchin…
tsmith023 Jan 30, 2026
32631b1
Merge branch 'dev/1.36' of https://github.com/weaviate/weaviate-pytho…
tsmith023 Jan 30, 2026
ab08410
SSB Improvements:
tsmith023 Jan 30, 2026
33ff4b9
Merge branch 'dev/1.36' of https://github.com/weaviate/weaviate-pytho…
tsmith023 Jan 30, 2026
69ce7d5
Fix test typos
tsmith023 Jan 30, 2026
d697b7c
Call `._wait` in sync wrapper
tsmith023 Jan 30, 2026
687c7de
Update CI version of `1.36.0-dev`
tsmith023 Jan 30, 2026
4c07a77
Merge pull request #1876 from weaviate/introduce-data-ingest-for-ssb
tsmith023 Jan 30, 2026
005fb12
Merge branch 'main' into dev/1.36
tsmith023 Jan 30, 2026
28d6b9b
Update other images in CI
tsmith023 Jan 30, 2026
31d3ce9
Remove long running rate limit tests
tsmith023 Jan 30, 2026
067f962
Merge branch 'dev/1.36' of https://github.com/weaviate/weaviate-pytho…
tsmith023 Jan 30, 2026
f452e31
- Move shutdown waiting back into `__generate_stream_requests` loop
tsmith023 Feb 2, 2026
f385d44
Bump `reqs.put` timeout
tsmith023 Feb 2, 2026
7626f99
Add more async locks in public functions
tsmith023 Feb 3, 2026
d4498a4
Relinquish control back to event loop on obj/ref add
tsmith023 Feb 3, 2026
06726fe
Add new is_hungup event to try and avoid deadlock when client exceeds…
tsmith023 Feb 4, 2026
66407ec
- Improvements to workflow between loop/send when stream close
tsmith023 Feb 4, 2026
56829e7
Skip test if less than 1.36
tsmith023 Feb 4, 2026
45b0056
Update CI image
tsmith023 Feb 6, 2026
a6adee2
Avoid index errors when adding back uuids/beacons after oom
tsmith023 Feb 9, 2026
83076f8
Merge branch 'main' into rob/spfresh
rlmanrique Feb 10, 2026
8d90ee5
Merge branch 'main' into rob/spfresh
rlmanrique Feb 10, 2026
268aae2
Add test for HFresh collection creation
rlmanrique Feb 10, 2026
c107de6
make a request and return resposne
DanielJanicek Feb 12, 2026
fbbaae8
Update to use latest protos on `main`
tsmith023 Feb 17, 2026
89f89b2
Merge branch 'main' of https://github.com/weaviate/weaviate-python-cl…
tsmith023 Feb 17, 2026
6e7dc7d
request in config
DanielJanicek Feb 17, 2026
dc7bf87
fix validation
DanielJanicek Feb 17, 2026
feb69a5
add pyi files and test stub
DanielJanicek Feb 17, 2026
b1ff44c
test passing locally
DanielJanicek Feb 17, 2026
52675cd
use rc version in tests for 36
DanielJanicek Feb 17, 2026
f9d40cc
Merge branch 'dev/1.36' into djanicek/drop-prop-index
DanielJanicek Feb 17, 2026
9a8039f
remove TODO and conflict
DanielJanicek Feb 17, 2026
198b3fe
fix version typo
DanielJanicek Feb 17, 2026
5add7b7
trigger tests
DanielJanicek Feb 17, 2026
c3af9b4
fix version check
DanielJanicek Feb 17, 2026
219b030
Merge branch 'djanicek/drop-prop-index' of https://github.com/weaviat…
tsmith023 Feb 18, 2026
805938d
Remove old poc impl
tsmith023 Feb 18, 2026
e72cf05
Use `IndexName` is test types
tsmith023 Feb 18, 2026
9321378
Re-export `IndexName` in `weaviate.classes`
tsmith023 Feb 18, 2026
3756d14
Merge pull request #1940 from weaviate/djanicek/drop-prop-index
tsmith023 Feb 18, 2026
28d5beb
Add validation of each obj_size in batch, if too big throw exception
tsmith023 Feb 18, 2026
442cba8
Introduce async repl conf in (re)configure and unit tests of usage
tsmith023 Feb 19, 2026
6d15263
Add support for cancelling backup restore ops
tsmith023 Feb 20, 2026
c75629c
Merge pull request #1956 from weaviate/1.36/support-restore-cancellation
dirkkul Feb 23, 2026
96a2a09
Merge branch 'dev/1.36' into 1.36/add-support-for-async-repl-config
dirkkul Feb 23, 2026
bf0d02a
Merge branch 'main' into dev/1.36
dirkkul Feb 23, 2026
eef7e42
Merge branch 'dev/1.36' into 1.36/add-support-for-async-repl-config
dirkkul Feb 23, 2026
1ea40f4
Merge pull request #1953 from weaviate/1.36/add-support-for-async-rep…
dirkkul Feb 23, 2026
82e7071
remove unused imports
robbespo00 Feb 23, 2026
401ddd4
Merge branch 'dev/1.36' into rob/spfresh
dirkkul Feb 23, 2026
4686e46
add new tests
robbespo00 Feb 23, 2026
5d40551
run ruff linter
robbespo00 Feb 23, 2026
461b963
ruff check
robbespo00 Feb 23, 2026
55028c3
Merge pull request #1848 from weaviate/rob/spfresh
robbespo00 Feb 23, 2026
6959d7a
Merge branch 'main' into dev/1.36
dirkkul Feb 23, 2026
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
27 changes: 15 additions & 12 deletions .github/workflows/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ env:
WEAVIATE_133: 1.33.10
WEAVIATE_134: 1.34.5
WEAVIATE_135: 1.35.0
WEAVIATE_136: 1.36.0-rc.0


jobs:
lint-and-format:
Expand Down Expand Up @@ -154,11 +156,11 @@ jobs:
fail-fast: false
matrix:
versions: [
{ py: "3.10", weaviate: $WEAVIATE_132, grpc: "1.59.0"},
{ py: "3.11", weaviate: $WEAVIATE_132, grpc: "1.66.0"},
{ py: "3.12", weaviate: $WEAVIATE_132, grpc: "1.70.0"},
{ py: "3.13", weaviate: $WEAVIATE_132, grpc: "1.72.1"},
{ py: "3.14", weaviate: $WEAVIATE_132, grpc: "1.76.0"}
{ py: "3.10", weaviate: $WEAVIATE_136, grpc: "1.59.0"},
{ py: "3.11", weaviate: $WEAVIATE_136, grpc: "1.66.0"},
{ py: "3.12", weaviate: $WEAVIATE_136, grpc: "1.70.0"},
{ py: "3.13", weaviate: $WEAVIATE_136, grpc: "1.72.1"},
{ py: "3.14", weaviate: $WEAVIATE_136, grpc: "1.76.0"}
]
optional_dependencies: [false]
steps:
Expand Down Expand Up @@ -209,11 +211,11 @@ jobs:
fail-fast: false
matrix:
versions: [
{ py: "3.10", weaviate: $WEAVIATE_132},
{ py: "3.11", weaviate: $WEAVIATE_132},
{ py: "3.12", weaviate: $WEAVIATE_132},
{ py: "3.13", weaviate: $WEAVIATE_132},
{ py: "3.14", weaviate: $WEAVIATE_132}
{ py: "3.10", weaviate: $WEAVIATE_136},
{ py: "3.11", weaviate: $WEAVIATE_136},
{ py: "3.12", weaviate: $WEAVIATE_136},
{ py: "3.13", weaviate: $WEAVIATE_136},
{ py: "3.14", weaviate: $WEAVIATE_136}
]
optional_dependencies: [false]
steps:
Expand Down Expand Up @@ -305,8 +307,9 @@ jobs:
$WEAVIATE_131,
$WEAVIATE_132,
$WEAVIATE_133,
$WEAVIATE_134
$WEAVIATE_135
$WEAVIATE_134,
$WEAVIATE_135,
$WEAVIATE_136
]
steps:
- name: Checkout
Expand Down
65 changes: 63 additions & 2 deletions integration/test_backup_v4.py
Original file line number Diff line number Diff line change
Expand Up @@ -497,13 +497,13 @@ def test_backup_and_restore_with_collection_and_config_1_24_x(


@pytest.mark.parametrize("dynamic_backup_location", [False, True])
def test_cancel_backup(
def test_cancel_backup_create(
client: weaviate.WeaviateClient,
dynamic_backup_location: bool,
tmp_path: pathlib.Path,
request: SubRequest,
) -> None:
"""Cancel backup without waiting."""
"""Cancel backup create without waiting."""
backup_id = unique_backup_id(request.node.name)
if client._connection._weaviate_version.is_lower_than(1, 24, 25):
pytest.skip("Cancel backups is only supported from 1.24.25")
Expand Down Expand Up @@ -543,6 +543,67 @@ def test_cancel_backup(
assert status_resp.status == BackupStatus.CANCELED or status_resp.status == BackupStatus.SUCCESS


@pytest.mark.parametrize("dynamic_backup_location", [False, True])
def test_cancel_backup_restore(
client: weaviate.WeaviateClient,
dynamic_backup_location: bool,
tmp_path: pathlib.Path,
request: SubRequest,
) -> None:
"""Cancel backup restore without waiting."""
backup_id = unique_backup_id(request.node.name)
if client._connection._weaviate_version.is_lower_than(1, 36, 0):
pytest.skip("Cancel restores is only supported from 1.36.0")

backup_location: Optional[wvc.backup.BackupLocationType] = None
if dynamic_backup_location:
backup_location = wvc.backup.BackupLocation.FileSystem(path=str(tmp_path))

c_name = "Restore"
c = client.collections.create(
name=c_name, properties=[Property(name="name", data_type=DataType.TEXT)]
)
c.data.insert({"name": "test"})

resp = client.backup.create(
backup_id=backup_id,
backend=BACKEND,
backup_location=backup_location,
include_collections=[c_name],
wait_for_completion=True,
)
assert resp.status == BackupStatus.SUCCESS

client.collections.delete(c_name)

resp = client.backup.restore(
backup_id=backup_id,
backend=BACKEND,
backup_location=backup_location,
include_collections=[c_name],
)
assert resp.status == BackupStatus.STARTED

assert client.backup.cancel(
backup_id=backup_id, backend=BACKEND, backup_location=backup_location, operation="restore"
)

start = time.time()
while time.time() - start < 5:
status_resp = client.backup.get_restore_status(
backup_id=backup_id, backend=BACKEND, backup_location=backup_location
)
if status_resp.status == BackupStatus.CANCELED:
break
time.sleep(0.1)

status_resp = client.backup.get_restore_status(
backup_id=backup_id, backend=BACKEND, backup_location=backup_location
)
# there can be a race between the cancel and the backup completion
assert status_resp.status == BackupStatus.CANCELED or status_resp.status == BackupStatus.SUCCESS


def test_backup_and_restore_with_roles_and_users(
client_factory: ClientFactory, request: SubRequest
) -> None:
Expand Down
150 changes: 128 additions & 22 deletions integration/test_batch_v4.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
from typing import Callable, Generator, List, Optional, Protocol, Tuple

import pytest
import pytest_asyncio
from _pytest.fixtures import SubRequest

import weaviate
Expand Down Expand Up @@ -119,6 +120,53 @@ def _factory(
client_fixture.close()


class AsyncClientFactory(Protocol):
"""Typing for fixture."""

async def __call__(
self, name: str = "", ports: Tuple[int, int] = (8080, 50051), multi_tenant: bool = False
) -> Tuple[weaviate.WeaviateAsyncClient, str]:
"""Typing for fixture."""
...


@pytest_asyncio.fixture
async def async_client_factory(request: SubRequest):
name_fixtures: List[str] = []
client_fixture: Optional[weaviate.WeaviateAsyncClient] = None

async def _factory(
name: str = "", ports: Tuple[int, int] = (8080, 50051), multi_tenant: bool = False
):
nonlocal client_fixture, name_fixtures # noqa: F824
name_fixture = _sanitize_collection_name(request.node.name) + name
name_fixtures.append(name_fixture)
if client_fixture is None:
client_fixture = weaviate.use_async_with_local(grpc_port=ports[1], port=ports[0])
await client_fixture.connect()

if await client_fixture.collections.exists(name_fixture):
await client_fixture.collections.delete(name_fixture)

await client_fixture.collections.create(
name=name_fixture,
properties=[
Property(name="name", data_type=DataType.TEXT),
Property(name="age", data_type=DataType.INT),
],
references=[ReferenceProperty(name="test", target_collection=name_fixture)],
multi_tenancy_config=Configure.multi_tenancy(multi_tenant),
vectorizer_config=Configure.Vectorizer.none(),
)
return client_fixture, name_fixture

try:
yield _factory
finally:
if client_fixture is not None:
await client_fixture.close()


def test_add_objects_in_multiple_batches(client_factory: ClientFactory) -> None:
client, name = client_factory()
with client.batch.rate_limit(50) as batch:
Expand Down Expand Up @@ -365,16 +413,14 @@ def test_add_ref_batch_with_tenant(client_factory: ClientFactory) -> None:
@pytest.mark.parametrize(
"batching_method",
[
# lambda client: client.batch.dynamic(),
# lambda client: client.batch.fixed_size(),
# lambda client: client.batch.rate_limit(9999),
lambda client: client.batch.experimental(concurrency=1),
lambda client: client.batch.dynamic(),
lambda client: client.batch.fixed_size(),
lambda client: client.batch.stream(concurrency=1),
],
ids=[
# "test_add_ten_thousand_data_objects_dynamic",
# "test_add_ten_thousand_data_objects_fixed_size",
# "test_add_ten_thousand_data_objects_rate_limit",
"test_add_ten_thousand_data_objects_experimental",
"test_add_ten_thousand_data_objects_dynamic",
"test_add_ten_thousand_data_objects_fixed_size",
"test_add_ten_thousand_data_objects_stream",
],
)
def test_add_ten_thousand_data_objects(
Expand All @@ -385,10 +431,10 @@ def test_add_ten_thousand_data_objects(
"""Test adding ten thousand data objects."""
client, name = client_factory()
if (
request.node.callspec.id == "test_add_ten_thousand_data_objects_experimental"
and client._connection._weaviate_version.is_lower_than(1, 34, 0)
request.node.callspec.id == "test_add_ten_thousand_data_objects_stream"
and client._connection._weaviate_version.is_lower_than(1, 36, 0)
):
pytest.skip("Server-side batching not supported in Weaviate < 1.34.0")
pytest.skip("Server-side batching not supported in Weaviate < 1.36.0")
nr_objects = 100000
import time

Expand Down Expand Up @@ -434,9 +480,11 @@ def test_add_one_hundred_objects_and_references_between_all(
) -> None:
"""Test adding one hundred objects and references between all of them."""
client, name = client_factory()
if client._connection._weaviate_version.is_lower_than(1, 36, 0):
pytest.skip("Server-side batching not supported in Weaviate < 1.36.0")
nr_objects = 100
uuids: List[UUID] = []
with client.batch.dynamic() as batch:
with client.batch.stream() as batch:
for i in range(nr_objects):
uuid_ = batch.add_object(
collection=name,
Expand Down Expand Up @@ -575,14 +623,12 @@ def test_add_1000_tenant_objects_with_async_indexing_and_wait_for_only_one(
[
lambda client: client.batch.dynamic(),
lambda client: client.batch.fixed_size(),
lambda client: client.batch.rate_limit(1000),
lambda client: client.batch.experimental(),
lambda client: client.batch.stream(),
],
ids=[
"test_add_one_hundred_objects_and_references_between_all_dynamic",
"test_add_one_hundred_objects_and_references_between_all_fixed_size",
"test_add_one_hundred_objects_and_references_between_all_rate_limit",
"test_add_one_hundred_objects_and_references_between_all_experimental",
"test_add_one_object_and_a_self_reference_dynamic",
"test_add_one_object_and_a_self_reference_fixed_size",
"test_add_one_object_and_a_self_reference_stream",
],
)
def test_add_one_object_and_a_self_reference(
Expand All @@ -593,11 +639,10 @@ def test_add_one_object_and_a_self_reference(
"""Test adding one object and a self reference."""
client, name = client_factory()
if (
request.node.callspec.id
== "test_add_one_hundred_objects_and_references_between_all_experimental"
and client._connection._weaviate_version.is_lower_than(1, 34, 0)
request.node.callspec.id == "test_add_one_object_and_a_self_reference_stream"
and client._connection._weaviate_version.is_lower_than(1, 36, 0)
):
pytest.skip("Server-side batching not supported in Weaviate < 1.34.0")
pytest.skip("Server-side batching not supported in Weaviate < 1.36.0")
with batching_method(client) as batch:
uuid = batch.add_object(collection=name, properties={})
batch.add_reference(
Expand Down Expand Up @@ -768,3 +813,64 @@ def test_references_with_to_uuids(client_factory: ClientFactory) -> None:

assert len(client.batch.failed_references) == 0, client.batch.failed_references
client.collections.delete(["target", "source"])


@pytest.mark.asyncio
async def test_add_one_hundred_thousand_objects_async_client(
async_client_factory: AsyncClientFactory,
) -> None:
"""Test adding one hundred thousand data objects."""
client, name = await async_client_factory()
if client._connection._weaviate_version.is_lower_than(1, 36, 0):
pytest.skip("Server-side batching not supported in Weaviate < 1.36.0")
nr_objects = 100000
import time

start = time.time()
async with client.batch.stream(concurrency=1) as batch:
for i in range(nr_objects):
await batch.add_object(
collection=name,
properties={"name": "test" + str(i)},
)
end = time.time()
print(f"Time taken to add {nr_objects} objects: {end - start} seconds")
assert len(client.batch.results.objs.errors) == 0
assert len(client.batch.results.objs.all_responses) == nr_objects
assert len(client.batch.results.objs.uuids) == nr_objects
assert await client.collections.use(name).length() == nr_objects
assert client.batch.results.objs.has_errors is False
assert len(client.batch.failed_objects) == 0, [
obj.message for obj in client.batch.failed_objects
]
await client.collections.delete(name)


def test_add_one_hundred_thousand_objects_sync_client(
client_factory: ClientFactory,
) -> None:
"""Test adding one hundred thousand data objects."""
client, name = client_factory()
if client._connection._weaviate_version.is_lower_than(1, 36, 0):
pytest.skip("Server-side batching not supported in Weaviate < 1.36.0")
nr_objects = 100000
import time

start = time.time()
with client.batch.stream(concurrency=1) as batch:
for i in range(nr_objects):
batch.add_object(
collection=name,
properties={"name": "test" + str(i)},
)
end = time.time()
print(f"Time taken to add {nr_objects} objects: {end - start} seconds")
assert len(client.batch.results.objs.errors) == 0
assert len(client.batch.results.objs.all_responses) == nr_objects
assert len(client.batch.results.objs.uuids) == nr_objects
assert len(client.collections.use(name)) == nr_objects
assert client.batch.results.objs.has_errors is False
assert len(client.batch.failed_objects) == 0, [
obj.message for obj in client.batch.failed_objects
]
client.collections.delete(name)
Loading
Loading