Skip to content

Deprecate client.batch() in favour of client.batch.configure() #433

Description

@tsmith023

Following discussions in weaviate/weaviate-io#1058 (comment) surrounding developer experience and confusion over the usage of client.batch as a context manager for performing batch operations to Weaviate, API improvements have been agreed upon to eliminate this confusion.

In short, due to the duplicate functions and effects of client.batch() and client.batch.configure() users are liable to mistakenly overwrite any configuration they manually specified with client.batch.configure() when calling client.batch() to enter a context managed scope. In order to avoid this, the client.batch() functionality will be moved entirely into client.batch.configure() with client.batch() becoming deprecated. Users will then access the Batch instance as a context manager through client.batch

Example usage:

client.batch.configure(
    batch_size=200,
    num_workers=2,
)

with client.batch as batch:
    for data_obj in data_objs:
        batch.add_data_object(
            data_obj,
            class_name,
        )

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions