Bug: Error trying to delete items with sub-query with multi-tenancy turned on

Hi, I’m trying to port my code to Weaviate’s multi-tenant system and I am having trouble making a where query that takes a tenant id

When I try without the tenant in the path — ie

 # Delete all pages referencing the same book
        batch.delete_objects(
            class_name=PAGE_CLASS,
            where={
                "path": ["book", "Book", "id"],
                "operator": "Equal",
                "valueText": book_uuid,
            },
            tenant=metadata["library_id"],
        )

it gives

weaviate.exceptions.WeaviateBaseError: Delete in batch! Unexpected status code: 422, with response body: {'error': [{'message': 'batch delete objects: cannot find objects: find matching doc ids in shard "zbf4s7y11skueza82yvyulwg": nested query: nested clause at pos 1: nested request to fetch matching IDs: object search at index book: class Book has multi-tenancy enabled, but request was without tenant'}]}

It would seem that the tenant id isn’t passed to subqueries when going through the batch endpoint

Does the Book class (that you cross-reference) works also with Get queries? and does the Book class belong to the same tenant?

@antas-marcin

Does the Book class (that you cross-reference) works also with Get queries?

No (updated)

does the Book class belong to the same tenant?

Yes

Here’s a notebook with a fully reproducible error: multitenant-batch.ipynb · GitHub

Actually @antas-marcin, just did a proper get + where query and it does not work. I updated the above post and gist.

The bug was fixed in the following patch release Release v1.20.3 - Multi-Tenancy search using cross-reference and proper vector sync to target nodes during read repair Fixes · weaviate/weaviate · GitHub