Changelog¶
Version 3.11.0¶
This minor version includes:
New status code attribute for
UnexpectedStatusCodeExceptionthat can be accessed like this:try: # your code except weaviate.UnexpectedStatusCodeException as err: print(err.status_code)
Fix for
get_meta().Caches server version at
Clientinitialization. This improves batch reference creation performance.Changes accepted data types for arguments
from_object_uuidandto_object_uuidof the methodadd_reference()tostranduuid.UUID.- Adds automatic retry for failed objects. It can be configured using the
weaviate_error_retriesargument for theconfigure()or__call__(), and should be an instance ofWeaviateErrorRetryConf. It can be used like this:All errors:
from weaviate import WeaviateErrorRetryConf with client.batch( weaviate_error_retries=WeaviateErrorRetryConf(number_retries=3), ) as batch: # Your code
Exclude errors, all the other errors will be retried:
from weaviate import WeaviateErrorRetryConf with client.batch( weaviate_error_retries=WeaviateErrorRetryConf(number_retries=3, errors_to_exclude=["Ignore me", "other error to ignore"]), ) as batch: # Your code
Include errors, all the other errors will be ignored:
from weaviate import WeaviateErrorRetryConf with client.batch( weaviate_error_retries=WeaviateErrorRetryConf(number_retries=3, errors_to_include=["error to retry", "other error to test again"]), ) as batch: # Your code
Adds new arguments
sortandoffsetforget().
Version 3.10.0¶
This minor version includes:
Improves error message for error
"413: Payload Too Large"- Adds new
Clientcredential OIDC flow method:client_credentials_config = weaviate.AuthClientCredentials( client_secret = "client_secret", scope = "scope1 scope2" # optional, depends on the configuration of your identity provider ) client = weaviate.Client("https://localhost:8080", auth_client_secret=client_credentials_config)
Improves size of batches on dynamic batching.
New
limitargument toget()method of theDataObjectclient attribute.Bump minimum version of request to
2.28.0- Adds support for
node_nameandconsistency_levelfor bothget()andget_by_id()of theDataObjectclient attribute. This can be used ONLY with Weaviate Serverv1.17.0or later. - Adds support for replication factor in schema. This can be used ONLY with Weaviate Server
v1.17.0or later. This can be configured in class schema like this:my_class = { "class": "MyClass", ..., "replicationConfig": { "factor": 1 } }
Adds support for
Bm25forGetqueries,with_bm25(). This can be used ONLY with Weaviate Serverv1.17.0or later.Adds support for
with_hybridforGetqueries,with_hybrid(). This can be used ONLY with Weaviate Serverv1.17.0or later.
Version 3.9.0¶
This minor version includes:
- Authentication using Bearer token, by adding
additional_headersto theClientinitialization: client = weaviate.Client( url='http://localhost:8080', additional_headers={ {"authorization": "Bearer <MY_TOKEN>"} } )
- Authentication using Bearer token, by adding
- Multi-threading
Batchimport: - Now it is possible to import data using multi-threading. The number of threads can be set using the new argument
num_workersinconfigure()and__call__(), defaults to 1 ( Use with care to not overload your weaviate instance.). - New argument
connection_error_retriesto retry onConnectionErrorthat can be set inconfigure()and__call__()or using the property getter/setter:client.batch.connection_error_retriesto get the value andclient.batch.connection_error_retries = 5to set the value. - New method
shutdown()to shutdown the existingBatchExecutor(ThreadExecutor) to release any resources that it is holding once the batch import is done. This method does NOT need to be called if using theBatchin a context manager (with). Also it is idempotent.
- Multi-threading
- New
ClientattributeClusterto check the status of the cluster nodes. - The method
get_nodes_status()returns the status of each node as a list of dictionaries. client.cluster.get_nodes_status()
- The method
- New
Fix for
replace()andupdate()when using with Weaviate server>=v1.14.0.New default
timeout_config:(10, 60).
Version 3.8.0¶
This minor version includes:
- Backup functionalities (
Backup): create()method to create backups (all/subset of classes).get_create_status()method to get the status of the created backup.restore()method to restore Weaviate from a backup (all/subset of classes).get_restore_status()method to get the status of the restored backup.
- Backup functionalities (
New
Clientattribute:backuptocreate,restoreandget statusof the backups. All backup operations MUST be done throughClient.backup.Added return value for
add_data_object(), it now returns the UUID of the added object, if one was not set then an UUIDv4 will be generated.
Version 3.7.0¶
This minor version includes:
Adds rolling average (last 5 batches) for batch creation time used by Dynamic Batching method.
Adds ability to use
get()without specifying any properties IF Additional Properties (with_additional()) are set before executing the query.Adds base Weaviate Exception
WeaviateBaseError.Adds ability to set proxies. Can be set at
Clientinitialization by using the newproxiesortrust_envarguments.Batchcreates UUIDs (UUIDv4) for all added objects that do not have one at client side (fixes data duplication on Batch retries).- Adds new methods for
WCSfor instances that have authentication enabled: get_users_of_cluster()to get users (emails) for all the users that have access to the created Weaviate instance.add_user_to_cluster()to add users (email) to the created Weaviate instance.remove_user_from_cluster()to remove user (email) from the created Weaviate instance.
- Adds new methods for
Version 3.6.0¶
This minor version includes:
New function in
check_batch_result()used to print errors from batch creation.- New function argument
class_nameforgenerate_local_beacon(), used ONLY with Weaviate Server version >=1.14.0 (defaults to
Nonefor backwards compatibility).
- New function argument
check_batch_result()is the defaultcallbackfunction forBatch(configure()and__call__()) (instead ofNone).- New method argument
to_object_class_nameforadd_reference(), used ONLY with Weaviate Server version >=1.14.0(defaults toNonefor backwards compatibility). Support for
distancein GraphQL filters (only with Weaviate server >=1.14.0).- For
DataObject: - New method argument
class_nameforget_by_id(),get(),delete()exists(), used ONLY with Weaviate Server version >=1.14.0(defaults toNonefor backwards compatibility). Deprecation Warning if Weaviate Server version >= 1.14.0 and
class_nameisNoneOR if Weaviate Server version < 1.14.0 andclass_nameis NOTNone.
- For
- For
Reference: Deprecation Warning if Weaviate Server version >= 1.14.0 and
class_nameisNoneOR if Weaviate Server version < 1.14.0 andclass_nameis NOTNone.
- For
Version 3.5.1¶
This patch version fixes:
- the rerank not being set bug in
with_ask(). - the bug when using double quotes(”) in question field in
with_ask(). - the bug where nearText filter checks for objects in moveXXX clause but never sets it.
Version 3.5.0¶
This minor version contains functionality for the new features introduced in Weaviate v1.13.0.
- New
Batchmethoddelete_objects()to delete all objects that match a particular expression (wherefilter). - New
GetBuildermethodwith_sort()that allows sorting data on a particular field/s. - New
AggregateBuildermethodwith_near_text()that allows to aggregate data that is matchingnearTextfilter. - New
AggregateBuildermethodwith_near_object()that allows to aggregate data that is matchingnearObjectfilter. - New
AggregateBuildermethodwith_near_vector()that allows to aggregate data that is matchingnearVectorfilter.
Version 3.4.2¶
exists().Version 3.4.1¶
exists().Version 3.4.0¶
invertedIndexConfig field.get_class_shards() to get all shards configuration of a particular class.update_class_shard() to update one/all shard/s configuration of a particular class.tokenization.Version 3.3.3¶
Version 3.3.2¶
DataObject too i.e. UUIDs without hyphens.Version 3.3.1¶
Version 3.3.0¶
with_offset() for the Get queries. This method should be used
with the with_limit(). This new feature (introduced in weaviate version 1.8.0) allows to
use pagination functionality with the Get queries. The offset represents the start index of the objects to be returned,
and the number of objects is specified by the with_limit() method.limit: 10. Then, to “display the second page of 10”, set offset: 10, limit: 10 and so on. E.g.
to show the 9th page of 10 results, set offset: 80, limit: 10 to effectively display results 81-90.Version 3.2.5¶
This patch fixes the 'Batch' object is not callable error.
Version 3.2.4¶
class_name and cross-refs dataType are implicitly capitalized. (This functionality is added because if class_name is not capitalized
then Weaviate server does it for you, and this was leading to errors where the client and server have different configurations.)Fixes/updates in Schema class:
- This patch fixes the
contains()to accept separate class schemas as argument i.e. it does not expect to have only this format:{"classes": [CLASS_1, CLASS_2, ...]}; now it is possible to pass justCLASS_Xas well.
Version 3.2.3¶
This patch fixes the with_near_object(). It uses now explicit string literals for id/beacon in nearoOject clauses.
Version 3.2.2¶
This patch adds support for array data types: boolean[], date[].
Version 3.2.1¶
This patch adds support for array data types: int[], number[], text[], string[].
Version 3.2.0¶
Fixes/updates in WCS class:
Fixed progress bar for
create(), it is being updated in Notebooks too, instead of printing each iteration on new line.Method
create()now prints the creation status above the bar.
Updates in gql sub-package:
# with 'nearText' filter
client.query\
.get('Article', ['title', 'author'])\
.near_text(
{
'concepts': ['Ecconomy'],
'autocorrect': True
}
)
# the concept should be corrected to 'Economy'
# with 'ask' filter
client.query\
.get('Article', ['title', 'author'])\
.with_ask(
{
'question': 'When was the last financial crysis?',
'autocorrect': True
}
)
# the question should be corrected to 'When was the last financial crisis?'
- New method
with_additional()is added to GET the _additional properties. Usage example:
# single additional property with this GraphQL query
'''
{
Get {
Article {
title
author
_additional {
id
}
}
}
}
'''
client.query\
.get('Article', ['title', 'author'])\
.with_additional('id') # argument as `str`
# multiple additional property with this GraphQL query
'''
{
Get {
Article {
title
author
_additional {
id
certainty
}
}
}
}
'''
client.query\
.get('Article', ['title', 'author'])\
.with_additional(['id', 'certainty']) # argument as `List[str]`
# additional properties as clause with this GraphQL query
'''
{
Get {
Article {
title
author
_additional {
classification {
basedOn
classifiedFields
completed
id
scope
}
}
}
}
}
'''
client.query\
.get('Article', ['title', 'author'])\
.with_additional(
{
'classification' : [
'basedOn',
'classifiedFields',
'completed',
'id',
'scope'
]
}
) # argument as `Dict[str, List[str]]`
# or with this GraphQL query
'''
{
Get {
Article {
title
author
_additional {
classification {
completed
}
}
}
}
}
'''
client.query\
.get('Article', ['title', 'author'])\
.with_additional(
{
'classification' : 'completed'
}
) # argument as `Dict[str, str]`
# additional properties as clause and clause settings with this GraphQL query
'''
{
Get {
Article {
title
author
_additional {
token (
properties: ["content"]
limit: 10
certainty: 0.8
) {
certainty
endPosition
entity
property
startPosition
word
}
}
}
}
}
'''
clause = {
'token': [
'certainty',
'endPosition',
'entity',
'property',
'startPosition',
'word',
]
}
settings = {
'properties': ["content"], # is required
'limit': 10, # optional, int
'certainty': 0.8 # optional, float
}
client.query\
.get('Article', ['title', 'author'])\
.with_additional(
(clause, settings)
) # argument as `Tuple[Dict[str, List[str]], Dict[str, Any]]`
# if the desired clause does not match any example above, then the clause can always
# be converted to string before passing it to the `.with_additional` method
Version 3.1.1¶
- Fixes in
WCSclass: - Make
WCS’s methods’ argumentcluster_namecase insensitive (lowercased inside the method) to match Weaviate Cloud Service’ naming convention, this fixes the error when Weaviate Cloud Service lowercases thecluster_namebut the users are not aware of this and get the exception KeyError.
- Fixes in
Version 3.1.0¶
- New
Batchmethods: pop_object()/pop_reference()to remove and return an added object/reference from theBatchat positionindex(by default-1).empty_objects()/empty_references()to remove all the existing objects/references from theBatchinstance.is_empty_objects()/is_empty_references()to check there are any objects/references in theBatchinstance.
- New
- Fixes in
WCSclass: Authentication only with
AuthClientPassword.The
get_cluster_config()does not raise an exception if the cluster does not exist but returns a empty configuration.The
delete_cluster()does not raise an exception if the cluster does not exist.
- Fixes in
Add
phoneNumberto the Weaviate’s primitive types. Thanks to GitHub user @cdpierse.Bug fix in
Connection.Fix
ConnectionErrorhandling.Optimization in
weaviate.batch.requestsandweaviate.connect.connection.
Version 3.0.0¶
weaviate.toolsmodule is REMOVED.Batcherclass is REMOVED.WCSclass is moved from theweaviate.toolsto the new moduleweaviate.wcsweaviate.tools.generate_uuidis REMOVED.
weaviate.util.generate_uuid5()is ADDED.- New
Batchclass implementation to replace the old one. This implementation uses theBatchRequestobjects under the hood, which means that there is no need to createBatchRequest’s anymore. This new class implementation allows 3 different batch creations methods: manual, auto-create and auto-create with dynamic batching. See theBatchdocumentation for more information. BatchRequestclasses (ObjectsBatchRequestandReferenceBatchRequest) are hidden from the user and should not be used anymore. This is due to the newBatchclass implementation.- New
Schemafield is ADDED, “shardingConfig”. It can bu used with Weaviate version >= 1.6.0. - New method
update_config()used to update mutable schema configuration (like efConstruction, …).