weaviate.schema package

Module used to manipulate schemas.

class weaviate.schema.Schema(connection: Connection)[source]

Bases: object

Schema class used to interact and manipulate schemas or classes.

Attributes

propertyweaviate.schema.properties.Property

A Property object to create new schema property/ies.

Initialize a Schema class instance.

Parameters

connectionweaviate.connect.Connection

Connection object to an active and running Weaviate instance.

add_class_tenants(class_name: str, tenants: List[Tenant]) None[source]

Add class’s tenants in Weaviate.

Parameters

class_namestr

The class for which we add tenants.

tenantsList[Tenant]

List of Tenants.

Examples

>>> tenants = [ Tenant(name="Tenant1"), Tenant(name="Tenant2") ]
>>> client.schema.add_class_tenants("class_name", tenants)

Raises

TypeError

If ‘tenants’ has not the correct type.

requests.ConnectionError

If the network connection to Weaviate fails.

weaviate.UnexpectedStatusCodeException

If Weaviate reports a non-OK status.

contains(schema: dict | str | None = None) bool[source]

Check if Weaviate already contains a schema.

Parameters

schemadict or str, optional

Schema as a Python dict, or the path to a JSON file or the URL of a JSON file. If a schema is given it is checked if this specific schema is already loaded. It will test only this schema. If the given schema is a subset of the loaded schema it will still return true, by default None.

Examples

>>> schema = client.schema.get()
>>> client.schema.contains(schema)
True
>>> schema = client.schema.get()
>>> schema['classes'].append(
    {
        "class": "Animal",
        "description": "An Animal",
        "properties": [
            {
                "name": "type",
                "dataType": ["text"],
                "description": "The animal type",
            }
        ]
    }
)
>>> client.schema.contains(schema)
False

Returns

bool

True if a schema is present, False otherwise.

create(schema: dict | str) None[source]

Create the schema of the Weaviate instance, with all classes at once.

Parameters

schemadict or str

Schema as a Python dict, or the path to a JSON file, or the URL of a JSON file.

Examples

>>> article_class = {
...     "class": "Article",
...     "description": "An article written by an Author",
...     "properties": [
...         {
...             "name": "title",
...             "dataType": ["text"],
...             "description": "The title the article",
...         },
...         {
...             "name": "hasAuthors",
...             "dataType": ["Author"],
...             "description": "Authors this article has",
...         }
...     ]
... }
>>> author_class = {
...     "class": "Author",
...     "description": "An Author class to store the author information",
...     "properties": [
...         {
...             "name": "name",
...             "dataType": ["text"],
...             "description": "The name of the author",
...         },
...         {
...             "name": "wroteArticles",
...             "dataType": ["Article"],
...             "description": "The articles of the author",
...         }
...     ]
... }
>>> client.schema.create({"classes": [article_class, author_class]})

If you have your schema saved in the ‘./schema/my_schema.json’ you can create it directly from the file.

>>> client.schema.create('./schema/my_schema.json')

Raises

TypeError

If the ‘schema’ is neither a string nor a dict.

ValueError

If ‘schema’ can not be converted into a Weaviate schema.

requests.ConnectionError

If the network connection to Weaviate fails.

weaviate.UnexpectedStatusCodeException

If Weaviate reports a non-OK status.

weaviate.SchemaValidationException

If the ‘schema’ could not be validated against the standard format.

create_class(schema_class: dict | str) None[source]

Create a single class as part of the schema in Weaviate.

Parameters

schema_classdict or str

Class as a Python dict, or the path to a JSON file, or the URL of a JSON file.

Examples

>>> author_class_schema = {
...     "class": "Author",
...     "description": "An Author class to store the author information",
...     "properties": [
...         {
...             "name": "name",
...             "dataType": ["text"],
...             "description": "The name of the author",
...         },
...         {
...             "name": "wroteArticles",
...             "dataType": ["Article"],
...             "description": "The articles of the author",
...         }
...     ]
... }
>>> client.schema.create_class(author_class_schema)

If you have your class schema saved in the ‘./schema/my_schema.json’ you can create it directly from the file.

>>> client.schema.create_class('./schema/my_schema.json')

Raises

TypeError

If the ‘schema_class’ is neither a string nor a dict.

ValueError

If ‘schema_class’ can not be converted into a Weaviate schema.

requests.ConnectionError

If the network connection to Weaviate fails.

weaviate.UnexpectedStatusCodeException

If Weaviate reports a non-OK status.

weaviate.SchemaValidationException

If the ‘schema_class’ could not be validated against the standard format.

delete_all() None[source]

Remove the entire schema from the Weaviate instance and all data associated with it.

Examples

>>> client.schema.delete_all()
delete_class(class_name: str) None[source]

Delete a schema class from Weaviate. This deletes all associated data.

Parameters

class_namestr

The class that should be deleted from Weaviate.

Examples

>>> client.schema.delete_class('Author')

Raises

TypeError

If ‘class_name’ argument not of type str.

requests.ConnectionError

If the network connection to Weaviate fails.

weaviate.UnexpectedStatusCodeException

If Weaviate reports a non-OK status.

exists(class_name: str) bool[source]

Check if class exists in Weaviate.

Parameters

class_namestr

The class whose existence is being checked.

Examples

>>> client.schema.exists(class_name="Exists")
True
>>> client.schema.exists(class_name="DoesNotExists")
False

Returns

bool

True if the class exists, False otherwise.

get(class_name: str | None = None) dict[source]

Get the schema from Weaviate.

Parameters

class_namestr, optional

The class for which to return the schema. If NOT provided the whole schema is returned, otherwise only the schema of this class is returned. By default None.

Returns

dict

A dict containing the schema. The schema may be empty. To see if a schema has already been loaded, use the contains method.

Examples

No schema present in client

>>> client.schema.get()
{'classes': []}

Schema present in client

>>> client.schema.get()
{
    "classes": [
        {
        "class": "Animal",
        "description": "An Animal",
        "invertedIndexConfig": {
            "cleanupIntervalSeconds": 60
        },
        "properties": [
            {
            "dataType": ["text"],
            "description": "The animal type",
            "name": "type"
            }
        ],
        "vectorIndexConfig": {
            "cleanupIntervalSeconds": 300,
            "maxConnections": 64,
            "efConstruction": 128,
            "vectorCacheMaxObjects": 500000
        },
        "vectorIndexType": "hnsw",
        "vectorizer": "text2vec-contextionary",
        "replicationConfig": {
            "factor": 1
        }
        }
    ]
}
>>> client.schema.get('Animal')
{
    "class": "Animal",
    "description": "An Animal",
    "invertedIndexConfig": {
        "cleanupIntervalSeconds": 60
    },
    "properties": [
        {
        "dataType": ["text"],
        "description": "The animal type",
        "name": "type"
        }
    ],
    "vectorIndexConfig": {
        "cleanupIntervalSeconds": 300,
        "maxConnections": 64,
        "efConstruction": 128,
        "vectorCacheMaxObjects": 500000
    },
    "vectorIndexType": "hnsw",
    "vectorizer": "text2vec-contextionary",
    "replicationConfig": {
        "factor": 1
    }
}

Raises

requests.ConnectionError

If the network connection to Weaviate fails.

weaviate.UnexpectedStatusCodeException

If Weaviate reports a non-OK status.

get_class_shards(class_name: str) list[source]

Get the status of all shards in an index.

Parameters

class_namestr

The class for which to return the status of all shards in an index.

Returns

list

The list of shards configuration.

Examples

Schema contains a single class: Article

>>> client.schema.get_class_shards('Article')
[{'name': '2rPgsA2yngW3', 'status': 'READY'}]

Raises

requests.ConnectionError

If the network connection to Weaviate fails.

weaviate.UnexpectedStatusCodeException

If Weaviate reports a non-OK status.

get_class_tenants(class_name: str) List[Tenant][source]

Get class’s tenants in Weaviate.

Parameters

class_namestr

The class for which we get tenants.

Examples

>>> client.schema.get_class_tenants("class_name")

Raises

requests.ConnectionError

If the network connection to Weaviate fails.

weaviate.UnexpectedStatusCodeException

If Weaviate reports a non-OK status.

remove_class_tenants(class_name: str, tenants: List[str]) None[source]

Remove class’s tenants in Weaviate.

Parameters

class_namestr

The class for which we remove tenants.

tenantsList[str]

List of tenant names to remove from the given class.

Examples

>>> client.schema.remove_class_tenants("class_name", ["Tenant1", "Tenant2"])

Raises

TypeError

If ‘tenants’ has not the correct type.

requests.ConnectionError

If the network connection to Weaviate fails.

weaviate.UnexpectedStatusCodeException

If Weaviate reports a non-OK status.

update_class_shard(class_name: str, status: str, shard_name: str | None = None) list[source]

Get the status of all shards in an index.

Parameters

class_namestr

The class for which to update the status of all shards in an index.

statusstr

The new status of the shard. The available options are: ‘READY’ and ‘READONLY’.

shard_namestr or None, optional

The shard name for which to update the status of the class of the shard. If None then all the shards are going to be updated to the ‘status’. By default None.

Returns

list

The updated statuses.

Examples

Schema contains a single class: Article

>>> client.schema.get_class_shards('Article')
[{'name': 'node1', 'status': 'READY'}, {'name': 'node2', 'status': 'READY'}]

For a specific shard:

>>> client.schema.update_class_shard('Article', 'READONLY', 'node2')
{'status': 'READONLY'}
>>> client.schema.get_class_shards('Article')
[{'name': 'node1', 'status': 'READY'}, {'name': 'node2', 'status': 'READONLY'}]

For all shards of the class:

>>> client.schema.update_class_shard('Article', 'READONLY')
[{'status': 'READONLY'},{'status': 'READONLY'}]
>>> client.schema.get_class_shards('Article')
[{'name': 'node1', 'status': 'READONLY'}, {'name': 'node2', 'status': 'READONLY'}]

Raises

requests.ConnectionError

If the network connection to Weaviate fails.

weaviate.UnexpectedStatusCodeException

If Weaviate reports a non-OK status.

update_class_tenants(class_name: str, tenants: List[Tenant]) None[source]

Update class tenants.

Use this when you want to move tenants from one activity state to another.

Parameters

class_namestr

The class for which we update tenants.

tenantsList[Tenant]

List of Tenants.

Examples

>>> client.schema.add_class_tenants(
        "class_name",
        [
            Tenant(activity_status=TenantActivityStatus.HOT, name="Tenant1")),
            Tenant(activity_status=TenantActivityStatus.COLD, name="Tenant2"))
            Tenant(name="Tenant3")
        ]
    )
>>> client.schema.update_class_tenants(
        "class_name",
        [
            Tenant(activity_status=TenantActivityStatus.COLD, name="Tenant1")),
            Tenant(activity_status=TenantActivityStatus.HOT, name="Tenant2"))
        ]
    )
>>> client.schema.get_class_tenants("class_name")
[
    Tenant(activity_status=TenantActivityStatus.COLD, name="Tenant1")),
    Tenant(activity_status=TenantActivityStatus.HOT, name="Tenant2")),
    Tenant(activity_status=TenantActivityStatus.HOT, name="Tenant3"))
]

Raises

requests.ConnectionError

If the network connection to Weaviate fails.

weaviate.UnexpectedStatusCodeException

If Weaviate reports a non-OK status.

update_config(class_name: str, config: dict) None[source]

Update a schema configuration for a specific class.

Parameters

class_namestr

The class for which to update the schema configuration.

configdict

The configurations to update (MUST follow schema format).

Example

In the example below we have a Weaviate instance with a class ‘Test’.

>>> client.schema.get('Test')
{
    'class': 'Test',
    ...
    'vectorIndexConfig': {
        'ef': -1,
        ...
    },
    ...
}
>>> client.schema.update_config(
...     class_name='Test',
...     config={
...         'vectorIndexConfig': {
...             'ef': 100,
...         }
...     }
... )
>>> client.schema.get('Test')
{
    'class': 'Test',
    ...
    'vectorIndexConfig': {
        'ef': 100,
        ...
    },
    ...
}

NOTE: When updating schema configuration, the ‘config’ MUST be sub-set of the schema, starting at the top level. In the example above we update ‘ef’ value, and for this we included the ‘vectorIndexConfig’ top level too.

Raises

requests.ConnectionError

If the network connection to Weaviate fails.

weaviate.UnexpectedStatusCodeException

If Weaviate reports a non-OK status.

class weaviate.schema.Tenant(name: str, activity_status: TenantActivityStatus = TenantActivityStatus.HOT)[source]

Bases: object

Tenant class used to describe a tenant in Weaviate.

Attributes

activity_statusTenantActivityStatus, optional

default: “HOT”

name: the name of the tenant.

activity_status: TenantActivityStatus = 'HOT'
name: str
class weaviate.schema.TenantActivityStatus(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)[source]

Bases: str, Enum

TenantActivityStatus class used to describe the activity status of a tenant in Weaviate.

Attributes

HOT: The tenant is fully active and can be used. COLD: The tenant is not active, files stored locally.

COLD = 'COLD'
HOT = 'HOT'

Subpackages

Submodules

weaviate.schema.crud_schema module

Schema class definition.

class weaviate.schema.crud_schema.Schema(connection: Connection)[source]

Bases: object

Schema class used to interact and manipulate schemas or classes.

Attributes

propertyweaviate.schema.properties.Property

A Property object to create new schema property/ies.

Initialize a Schema class instance.

Parameters

connectionweaviate.connect.Connection

Connection object to an active and running Weaviate instance.

add_class_tenants(class_name: str, tenants: List[Tenant]) None[source]

Add class’s tenants in Weaviate.

Parameters

class_namestr

The class for which we add tenants.

tenantsList[Tenant]

List of Tenants.

Examples

>>> tenants = [ Tenant(name="Tenant1"), Tenant(name="Tenant2") ]
>>> client.schema.add_class_tenants("class_name", tenants)

Raises

TypeError

If ‘tenants’ has not the correct type.

requests.ConnectionError

If the network connection to Weaviate fails.

weaviate.UnexpectedStatusCodeException

If Weaviate reports a non-OK status.

contains(schema: dict | str | None = None) bool[source]

Check if Weaviate already contains a schema.

Parameters

schemadict or str, optional

Schema as a Python dict, or the path to a JSON file or the URL of a JSON file. If a schema is given it is checked if this specific schema is already loaded. It will test only this schema. If the given schema is a subset of the loaded schema it will still return true, by default None.

Examples

>>> schema = client.schema.get()
>>> client.schema.contains(schema)
True
>>> schema = client.schema.get()
>>> schema['classes'].append(
    {
        "class": "Animal",
        "description": "An Animal",
        "properties": [
            {
                "name": "type",
                "dataType": ["text"],
                "description": "The animal type",
            }
        ]
    }
)
>>> client.schema.contains(schema)
False

Returns

bool

True if a schema is present, False otherwise.

create(schema: dict | str) None[source]

Create the schema of the Weaviate instance, with all classes at once.

Parameters

schemadict or str

Schema as a Python dict, or the path to a JSON file, or the URL of a JSON file.

Examples

>>> article_class = {
...     "class": "Article",
...     "description": "An article written by an Author",
...     "properties": [
...         {
...             "name": "title",
...             "dataType": ["text"],
...             "description": "The title the article",
...         },
...         {
...             "name": "hasAuthors",
...             "dataType": ["Author"],
...             "description": "Authors this article has",
...         }
...     ]
... }
>>> author_class = {
...     "class": "Author",
...     "description": "An Author class to store the author information",
...     "properties": [
...         {
...             "name": "name",
...             "dataType": ["text"],
...             "description": "The name of the author",
...         },
...         {
...             "name": "wroteArticles",
...             "dataType": ["Article"],
...             "description": "The articles of the author",
...         }
...     ]
... }
>>> client.schema.create({"classes": [article_class, author_class]})

If you have your schema saved in the ‘./schema/my_schema.json’ you can create it directly from the file.

>>> client.schema.create('./schema/my_schema.json')

Raises

TypeError

If the ‘schema’ is neither a string nor a dict.

ValueError

If ‘schema’ can not be converted into a Weaviate schema.

requests.ConnectionError

If the network connection to Weaviate fails.

weaviate.UnexpectedStatusCodeException

If Weaviate reports a non-OK status.

weaviate.SchemaValidationException

If the ‘schema’ could not be validated against the standard format.

create_class(schema_class: dict | str) None[source]

Create a single class as part of the schema in Weaviate.

Parameters

schema_classdict or str

Class as a Python dict, or the path to a JSON file, or the URL of a JSON file.

Examples

>>> author_class_schema = {
...     "class": "Author",
...     "description": "An Author class to store the author information",
...     "properties": [
...         {
...             "name": "name",
...             "dataType": ["text"],
...             "description": "The name of the author",
...         },
...         {
...             "name": "wroteArticles",
...             "dataType": ["Article"],
...             "description": "The articles of the author",
...         }
...     ]
... }
>>> client.schema.create_class(author_class_schema)

If you have your class schema saved in the ‘./schema/my_schema.json’ you can create it directly from the file.

>>> client.schema.create_class('./schema/my_schema.json')

Raises

TypeError

If the ‘schema_class’ is neither a string nor a dict.

ValueError

If ‘schema_class’ can not be converted into a Weaviate schema.

requests.ConnectionError

If the network connection to Weaviate fails.

weaviate.UnexpectedStatusCodeException

If Weaviate reports a non-OK status.

weaviate.SchemaValidationException

If the ‘schema_class’ could not be validated against the standard format.

delete_all() None[source]

Remove the entire schema from the Weaviate instance and all data associated with it.

Examples

>>> client.schema.delete_all()
delete_class(class_name: str) None[source]

Delete a schema class from Weaviate. This deletes all associated data.

Parameters

class_namestr

The class that should be deleted from Weaviate.

Examples

>>> client.schema.delete_class('Author')

Raises

TypeError

If ‘class_name’ argument not of type str.

requests.ConnectionError

If the network connection to Weaviate fails.

weaviate.UnexpectedStatusCodeException

If Weaviate reports a non-OK status.

exists(class_name: str) bool[source]

Check if class exists in Weaviate.

Parameters

class_namestr

The class whose existence is being checked.

Examples

>>> client.schema.exists(class_name="Exists")
True
>>> client.schema.exists(class_name="DoesNotExists")
False

Returns

bool

True if the class exists, False otherwise.

get(class_name: str | None = None) dict[source]

Get the schema from Weaviate.

Parameters

class_namestr, optional

The class for which to return the schema. If NOT provided the whole schema is returned, otherwise only the schema of this class is returned. By default None.

Returns

dict

A dict containing the schema. The schema may be empty. To see if a schema has already been loaded, use the contains method.

Examples

No schema present in client

>>> client.schema.get()
{'classes': []}

Schema present in client

>>> client.schema.get()
{
    "classes": [
        {
        "class": "Animal",
        "description": "An Animal",
        "invertedIndexConfig": {
            "cleanupIntervalSeconds": 60
        },
        "properties": [
            {
            "dataType": ["text"],
            "description": "The animal type",
            "name": "type"
            }
        ],
        "vectorIndexConfig": {
            "cleanupIntervalSeconds": 300,
            "maxConnections": 64,
            "efConstruction": 128,
            "vectorCacheMaxObjects": 500000
        },
        "vectorIndexType": "hnsw",
        "vectorizer": "text2vec-contextionary",
        "replicationConfig": {
            "factor": 1
        }
        }
    ]
}
>>> client.schema.get('Animal')
{
    "class": "Animal",
    "description": "An Animal",
    "invertedIndexConfig": {
        "cleanupIntervalSeconds": 60
    },
    "properties": [
        {
        "dataType": ["text"],
        "description": "The animal type",
        "name": "type"
        }
    ],
    "vectorIndexConfig": {
        "cleanupIntervalSeconds": 300,
        "maxConnections": 64,
        "efConstruction": 128,
        "vectorCacheMaxObjects": 500000
    },
    "vectorIndexType": "hnsw",
    "vectorizer": "text2vec-contextionary",
    "replicationConfig": {
        "factor": 1
    }
}

Raises

requests.ConnectionError

If the network connection to Weaviate fails.

weaviate.UnexpectedStatusCodeException

If Weaviate reports a non-OK status.

get_class_shards(class_name: str) list[source]

Get the status of all shards in an index.

Parameters

class_namestr

The class for which to return the status of all shards in an index.

Returns

list

The list of shards configuration.

Examples

Schema contains a single class: Article

>>> client.schema.get_class_shards('Article')
[{'name': '2rPgsA2yngW3', 'status': 'READY'}]

Raises

requests.ConnectionError

If the network connection to Weaviate fails.

weaviate.UnexpectedStatusCodeException

If Weaviate reports a non-OK status.

get_class_tenants(class_name: str) List[Tenant][source]

Get class’s tenants in Weaviate.

Parameters

class_namestr

The class for which we get tenants.

Examples

>>> client.schema.get_class_tenants("class_name")

Raises

requests.ConnectionError

If the network connection to Weaviate fails.

weaviate.UnexpectedStatusCodeException

If Weaviate reports a non-OK status.

remove_class_tenants(class_name: str, tenants: List[str]) None[source]

Remove class’s tenants in Weaviate.

Parameters

class_namestr

The class for which we remove tenants.

tenantsList[str]

List of tenant names to remove from the given class.

Examples

>>> client.schema.remove_class_tenants("class_name", ["Tenant1", "Tenant2"])

Raises

TypeError

If ‘tenants’ has not the correct type.

requests.ConnectionError

If the network connection to Weaviate fails.

weaviate.UnexpectedStatusCodeException

If Weaviate reports a non-OK status.

update_class_shard(class_name: str, status: str, shard_name: str | None = None) list[source]

Get the status of all shards in an index.

Parameters

class_namestr

The class for which to update the status of all shards in an index.

statusstr

The new status of the shard. The available options are: ‘READY’ and ‘READONLY’.

shard_namestr or None, optional

The shard name for which to update the status of the class of the shard. If None then all the shards are going to be updated to the ‘status’. By default None.

Returns

list

The updated statuses.

Examples

Schema contains a single class: Article

>>> client.schema.get_class_shards('Article')
[{'name': 'node1', 'status': 'READY'}, {'name': 'node2', 'status': 'READY'}]

For a specific shard:

>>> client.schema.update_class_shard('Article', 'READONLY', 'node2')
{'status': 'READONLY'}
>>> client.schema.get_class_shards('Article')
[{'name': 'node1', 'status': 'READY'}, {'name': 'node2', 'status': 'READONLY'}]

For all shards of the class:

>>> client.schema.update_class_shard('Article', 'READONLY')
[{'status': 'READONLY'},{'status': 'READONLY'}]
>>> client.schema.get_class_shards('Article')
[{'name': 'node1', 'status': 'READONLY'}, {'name': 'node2', 'status': 'READONLY'}]

Raises

requests.ConnectionError

If the network connection to Weaviate fails.

weaviate.UnexpectedStatusCodeException

If Weaviate reports a non-OK status.

update_class_tenants(class_name: str, tenants: List[Tenant]) None[source]

Update class tenants.

Use this when you want to move tenants from one activity state to another.

Parameters

class_namestr

The class for which we update tenants.

tenantsList[Tenant]

List of Tenants.

Examples

>>> client.schema.add_class_tenants(
        "class_name",
        [
            Tenant(activity_status=TenantActivityStatus.HOT, name="Tenant1")),
            Tenant(activity_status=TenantActivityStatus.COLD, name="Tenant2"))
            Tenant(name="Tenant3")
        ]
    )
>>> client.schema.update_class_tenants(
        "class_name",
        [
            Tenant(activity_status=TenantActivityStatus.COLD, name="Tenant1")),
            Tenant(activity_status=TenantActivityStatus.HOT, name="Tenant2"))
        ]
    )
>>> client.schema.get_class_tenants("class_name")
[
    Tenant(activity_status=TenantActivityStatus.COLD, name="Tenant1")),
    Tenant(activity_status=TenantActivityStatus.HOT, name="Tenant2")),
    Tenant(activity_status=TenantActivityStatus.HOT, name="Tenant3"))
]

Raises

requests.ConnectionError

If the network connection to Weaviate fails.

weaviate.UnexpectedStatusCodeException

If Weaviate reports a non-OK status.

update_config(class_name: str, config: dict) None[source]

Update a schema configuration for a specific class.

Parameters

class_namestr

The class for which to update the schema configuration.

configdict

The configurations to update (MUST follow schema format).

Example

In the example below we have a Weaviate instance with a class ‘Test’.

>>> client.schema.get('Test')
{
    'class': 'Test',
    ...
    'vectorIndexConfig': {
        'ef': -1,
        ...
    },
    ...
}
>>> client.schema.update_config(
...     class_name='Test',
...     config={
...         'vectorIndexConfig': {
...             'ef': 100,
...         }
...     }
... )
>>> client.schema.get('Test')
{
    'class': 'Test',
    ...
    'vectorIndexConfig': {
        'ef': 100,
        ...
    },
    ...
}

NOTE: When updating schema configuration, the ‘config’ MUST be sub-set of the schema, starting at the top level. In the example above we update ‘ef’ value, and for this we included the ‘vectorIndexConfig’ top level too.

Raises

requests.ConnectionError

If the network connection to Weaviate fails.

weaviate.UnexpectedStatusCodeException

If Weaviate reports a non-OK status.

class weaviate.schema.crud_schema.Tenant(name: str, activity_status: TenantActivityStatus = TenantActivityStatus.HOT)[source]

Bases: object

Tenant class used to describe a tenant in Weaviate.

Attributes

activity_statusTenantActivityStatus, optional

default: “HOT”

name: the name of the tenant.

activity_status: TenantActivityStatus = 'HOT'
name: str
class weaviate.schema.crud_schema.TenantActivityStatus(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)[source]

Bases: str, Enum

TenantActivityStatus class used to describe the activity status of a tenant in Weaviate.

Attributes

HOT: The tenant is fully active and can be used. COLD: The tenant is not active, files stored locally.

COLD = 'COLD'
HOT = 'HOT'