weaviate / weaviate-python-client

A python native client for easy interaction with a Weaviate instance.
https://weaviate.io/developers/weaviate/current/client-libraries/python.html
BSD 3-Clause "New" or "Revised" License
161 stars 70 forks source link

MultiTenancyConfig Mutable parameters is immutable #1313

Open mohamedshahin-weaviate opened 11 hours ago

mohamedshahin-weaviate commented 11 hours ago

How to reproduce this bug?

  1. Create a collection
  2. Enable MT
    multi_tenancy_config=Configure.multi_tenancy(
        enabled=True,
        auto_tenant_creation=False,
    )
  3. Ensure the schema is created and configuration is set as expected
  4. Use
    
    from weaviate.classes.config import Reconfigure

col_name = client.collections.get("") col_name.config.update( multi_tenancy_config=Reconfigure.multi_tenancy( auto_tenant_creation=True ) )


5. Observe the error

> UnexpectedStatusCodeError: Collection configuration may not have been updated.! Unexpected status code: 422, with response body: {'error': [{'message': 'module config is immutable'}]}.

By looking at Mutability in the docs, MultiTenancyConfig parameters are Mutable: https://weaviate.io/developers/weaviate/config-refs/schema#mutability

### What is the expected behavior?

To be able to update MultiTenancyConfig Mutable parameters between FALSE/TRUE

### What is the actual behavior?

{'error': [{'message': 'module config is immutable'}]}.

### Supporting information

Weaviate Client Version: 4.8.1
Weaviate Server Version: 1.25.14 (Also tested on 1.26)

### Server Version

1.25.14

### Code of Conduct

- [X] I have read and agree to the Weaviate's [Contributor Guide](https://weaviate.io/developers/contributor-guide) and [Code of Conduct](https://weaviate.io/service/code-of-conduct)
tsmith023 commented 10 hours ago

@mohamedshahin-weaviate, we have a test for this user journey here. Can you post the rest of your code that creates the collection? I have a feeling that might be the uniqueness to your problem causing the issue!

mohamedshahin-weaviate commented 9 hours ago

This is the collection I test with:

from weaviate.classes.config import Configure, Property, DataType, Tokenization

client.collections.create(
    "Transcription",
    vectorizer_config=Configure.Vectorizer.text2vec_openai(
        model="text-embedding-3-large",
        dimensions=3072,
    ),
    properties=[
        Property(
            name="text",
            data_type=DataType.TEXT,
            index_filterable=True,
            index_searchable=True,
            tokenization=Tokenization.LOWERCASE,
        ),
        Property(
            name="createdAt",
            data_type=DataType.DATE,
            index_filterable=True,
        ),
        Property(
            name="searchText",
            data_type=DataType.TEXT,
            index_filterable=True,
            index_searchable=True,
            tokenization=Tokenization.LOWERCASE,
        ),
        Property(
            name="transcriptionIntervalId",
            data_type=DataType.TEXT,
            index_filterable=True,
            index_searchable=True,
            tokenization=Tokenization.FIELD,
            skip_vectorization=True,
        ),
    ],
    inverted_index_config=Configure.inverted_index(
        bm25_b=0.7,
        bm25_k1=1.25,
        index_null_state=True,
        index_property_length=True,
        index_timestamps=True
    ),
    multi_tenancy_config=Configure.multi_tenancy(
        enabled=True,
        auto_tenant_creation=True,
    )
)