Repository navigation
Conversation
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Orca Security Scan Summary
| Status | Check | Issues by priority | |
|---|---|---|---|
| Infrastructure as Code | View in Orca | ||
| SAST | View in Orca | ||
| Secrets | View in Orca | ||
| Vulnerabilities | View in Orca |
|
To avoid any confusion in the future about your contribution to Weaviate, we work with a Contributor License Agreement. If you agree, you can simply add a comment to this PR that you agree with the CLA so that we can merge. |
|
I agree to the Contributor License Agreement |
chrikrah
left a comment
There was a problem hiding this comment.
The mock tests pin limit through both paths, and they fail without the two production files. Ready to go in from my side.
# exported tree of a5562401, Python 3.12, weaviate imported from the tree
$ pytest -q mock_tests/test_batch_delete.py
11 passed
# grpc_batch_delete.py and classes/batch.py from base 0e821a53, stubs and tests kept
11 failed
$ pytest -q -n 4 test && pytest -q mock_tests && pytest -q proto_test/test_proto.py
619 passed, 1 skipped / 110 passed / 4 passed
$ pre-commit run --all-files # ruff, ruff format, flake8: no finding in changed files
# not run: integration/ (needs a live Weaviate)
non-blocking: the field first ships in v1.39.7 (batch_delete.proto at v1.39.6 has no limit = 6), and by my reading test_delete_many_limit would fail against 1.39.0 to 1.39.6. CI pins 1.39.13. Could you move the gate to is_lower_than(1, 39, 7) and the docstring to "< 1.39.7"?
…ng to 1.39.7 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
chrikrah
left a comment
There was a problem hiding this comment.
dd07c14 moves both the integration gate and the docstring to 1.39.7, which is the first server that sends limit, and nothing else changed. Still good to go from my side.
# exported tree of dd07c147 (previous head a5562401), Python 3.12, weaviate.__file__ from the export
$ pytest -q mock_tests/test_batch_delete.py
11 passed
$ git diff a5562401 dd07c147 --stat
integration/test_collection_batch_delete.py | 2 +-
weaviate/collections/classes/batch.py | 2 +-
# not run: integration/ (needs a live Weaviate at 1.39.0 to 1.39.6 to hit the new branch)
Nothing more from me here; it now needs a maintainer.
Summary
Weaviate 1.39+ exposes the per-call batch-delete cap (
QUERY_MAXIMUM_RESULTS) asoptional int64 limit = 6on gRPCBatchDeleteReply. This PR regenerates the versionedbatch_deleteprotobuf stubs and surfaces the field onDeleteManyReturn.limitso callers can tell when adelete_many()call was capped (matches > limit) without hardcoding server configuration.Changes
v4216,v5261,v6300): Regenerated viaweaviate/proto/v1/regen.shagainst Weaviatev1.40.7, addingBatchDeleteReply.limit.weaviate/collections/classes/batch.py: Addedlimit: Optional[int] = NonetoDeleteManyReturn(additive and backward-compatible with existing positional/keyword callers and@overloadannotations).weaviate/collections/batch/grpc_batch_delete.py: Populatedlimit = res.limit if res.HasField("limit") else Nonefor bothverbose=Trueandverbose=False(shared across sync and async clients; preserves explicit0and returnsNoneon servers < 1.39).mock_tests/test_batch_delete.py: Sync and async mock gRPC coverage for capped (matches=8, successful=5, limit=5), uncapped (matches=3, successful=3, limit=5), explicit zero (limit=0), and omitted (limit=None) replies acrossverbose=False/True.integration/test_collection_batch_delete.py: Addedtest_delete_many_limitacrossverboseanddry_runcombinations, version-gated for Weaviate< 1.39vs>= 1.39.Validation
1.40.7withQUERY_MAXIMUM_RESULTS=5(sync + async): confirmed capped (matches=6, successful=5, limit=5), exact boundary (matches=5, successful=5, limit=5), uncapped (matches=3, successful=3, limit=5),verbose=True, anddry_run=Truepytest integration/test_collection_batch_delete.py -k test_delete_many_limitagainst live Weaviate1.40.7(4 passed)pytest proto_test/test_proto.py mock_tests/test_batch_delete.py(15 passed)pytest test(619 passed, 1 skipped) andpytest mock_tests(110 passed)ruff check&ruff format --diff(clean)pyrightonweaviate/andintegration/(0 errors)