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,
)
Following discussions in weaviate/weaviate-io#1058 (comment) surrounding developer experience and confusion over the usage of
client.batchas 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()andclient.batch.configure()users are liable to mistakenly overwrite any configuration they manually specified withclient.batch.configure()when callingclient.batch()to enter a context managed scope. In order to avoid this, theclient.batch()functionality will be moved entirely intoclient.batch.configure()withclient.batch()becoming deprecated. Users will then access theBatchinstance as a context manager throughclient.batchExample usage: