This minor version includes:
- Adds rolling average (last 5 batches) for batch creation time used by Dynamic Batching method.
- Adds ability to use :meth:`~weaviate.gql.Query.get` without specifying any properties IF Additional Properties (:meth:`~weaviate.gql.get.GetBuilder.with_additional`) are set before executing the query.
- Adds base Weaviate Exception :class:`~weaviate.exceptions.WeaviateBaseError`.
- Adds ability to set proxies. Can be set at :class:`~weaviate.client.Client` initialization by using the new
proxies
ortrust_env
arguments. - :class:`~weaviate.batch.crud_batch.Batch` creates UUIDs (UUIDv4) for all added objects that do not have one at client side (fixes data duplication on Batch retries).
- Adds new methods for :class:`~weaviate.wcs.WCS` for instances that have authentication enabled:
- :meth:`~weaviate.wcs.WCS.get_users_of_cluster` to get users (emails) for all the users that have access to the created Weaviate instance.
- :meth:`~weaviate.wcs.WCS.add_user_to_cluster` to add users (email) to the created Weaviate instance.
- :meth:`~weaviate.wcs.WCS.remove_user_from_cluster` to remove user (email) from the created Weaviate instance.
This minor version includes:
New function in :func:`~weaviate.util.check_batch_result` used to print errors from batch creation.
- New function argument
class_name
for :func:`~weaviate.util.generate_local_beacon`, used ONLY with Weaviate Server version >=1.14.0
(defaults to
None
for backwards compatibility).
- New function argument
- :func:`~weaviate.util.check_batch_result` is the default
callback
function for :class:`~weaviate.batch.Batch` (:meth:`~weaviate.batch.Batch.configure` and :meth:`~weaviate.batch.Batch.__call__`) (instead ofNone
). - New method argument
to_object_class_name
for :meth:`~weaviate.batch.Batch.add_reference`, used ONLY with Weaviate Server version >=1.14.0
(defaults toNone
for backwards compatibility). Support for
distance
in GraphQL filters (only with Weaviate server >=1.14.0
).- For :class:`~weaviate.data.DataObject`:
- New method argument
class_name
for :meth:`~weaviate.data.DataObject.get_by_id`, :meth:`~weaviate.data.DataObject.get`, :meth:`~weaviate.data.DataObject.delete` :meth:`~weaviate.data.DataObject.exists`, used ONLY with Weaviate Server version >=1.14.0
(defaults toNone
for backwards compatibility). Deprecation Warning if Weaviate Server version >= 1.14.0 and
class_name
isNone
OR if Weaviate Server version < 1.14.0 andclass_name
is NOTNone
.
- For :class:`~weaviate.data.references.Reference`:
- New method arguments
from_class_name
andto_class_name
(to_class_names
for :meth:`~weaviate.data.references.Reference.update`) for :meth:`~weaviate.data.references.Reference.add`, :meth:`~weaviate.data.references.Reference.delete`, :meth:`~weaviate.data.references.Reference.update`, used ONLY with Weaviate Server version >=1.14.0
(defaults toNone
for backwards compatibility). Deprecation Warning if Weaviate Server version >= 1.14.0 and
class_name
isNone
OR if Weaviate Server version < 1.14.0 andclass_name
is NOTNone
.
This patch version fixes:
- the rerank not being set bug in :meth:`~weaviate.gql.get.GetBuilder.with_ask`.
- the bug when using double quotes(") in question field in :meth:`~weaviate.gql.get.GetBuilder.with_ask`.
- the bug where nearText filter checks for objects in moveXXX clause but never sets it.
This minor version contains functionality for the new features introduced in Weaviate v1.13.0
.
- New :class:`~weaviate.batch.Batch` method :meth:`~weaviate.batch.Batch.delete_objects` to delete all objects that match a particular expression (
where
filter). - New :class:`~weaviate.gql.get.GetBuilder` method :meth:`~weaviate.gql.get.GetBuilder.with_sort` that allows sorting data on a particular field/s.
- New :class:`~weaviate.gql.aggregate.AggregateBuilder` method :meth:`~weaviate.gql.aggregate.AggregateBuilder.with_near_text` that allows to aggregate data that is matching
nearText
filter. - New :class:`~weaviate.gql.aggregate.AggregateBuilder` method :meth:`~weaviate.gql.aggregate.AggregateBuilder.with_near_object` that allows to aggregate data that is matching
nearObject
filter. - New :class:`~weaviate.gql.aggregate.AggregateBuilder` method :meth:`~weaviate.gql.aggregate.AggregateBuilder.with_near_vector` that allows to aggregate data that is matching
nearVector
filter.
invertedIndexConfig
field.tokenization
.Get
queries. This method should be used
with the :meth:`~weaviate.gql.get.GetBuilder.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 :meth:`~weaviate.gql.get.GetBuilder.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.This patch fixes the 'Batch' object is not callable
error.
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 :class:`~weaviate.schema.Schema` class:
- This patch fixes the :meth:`~weaviate.schema.Schema.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_X
as well.
This patch fixes the :meth:`~weaviate.gql.get.GetBuilder.with_near_object`. It uses now explicit string literals for id
/beacon
in nearoOject clauses.
This patch adds support for array data types: boolean[]
, date[]
.
This patch adds support for array data types: int[]
, number[]
, text[]
, string[]
.
Fixes/updates in :class:`~weaviate.wcs.WCS` class:
- Fixed progress bar for :meth:`~weaviate.wcs.WCS.create`, it is being updated in Notebooks too, instead of printing each iteration on new line.
- Method :meth:`~weaviate.wcs.WCS.create` now prints the creation status above the bar.
Updates in :mod:`~weaviate.gql` sub-package:
- New key-value
autocorrect: <bool>
introduced for the :class:`~weaviate.gql.filter.NearText` and :class:`~weaviate.gql.filter.Ask` filters. Theautocorrect
is enabled only if Weaviate server has thetext-spellcheck
module enabled. Ifautocorrect
isTrue
the query is corrected before the query is made. Usage example:
# 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 :meth:`~weaviate.gql.get.GetBuilder.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
- Fixes in :class:`~weaviate.wcs.WCS` class:
- Make :class:`~weaviate.wcs.WCS`'s methods' argument
cluster_name
case insensitive (lowercased inside the method) to match Weaviate Cloud Service' naming convention, this fixes the error when Weaviate Cloud Service lowercases thecluster_name
but the users are not aware of this and get the exception KeyError.
- New :class:`~weaviate.batch.Batch` methods:
- :meth:`~weaviate.batch.Batch.pop_object` / :meth:`~weaviate.batch.Batch.pop_reference` to remove and return an added object/reference from the :class:`~weaviate.batch.Batch` at position
index
(by default-1
). - :meth:`~weaviate.batch.Batch.empty_objects` / :meth:`~weaviate.batch.Batch.empty_references` to remove all the existing objects/references from the :class:`~weaviate.batch.Batch` instance.
- :meth:`~weaviate.batch.Batch.is_empty_objects` / :meth:`~weaviate.batch.Batch.is_empty_references` to check there are any objects/references in the :class:`~weaviate.batch.Batch` instance.
- Fixes in :class:`~weaviate.wcs.WCS` class:
Authentication only with :class:`~weaviate.auth.AuthClientPassword`.
- The :meth:`~weaviate.wcs.WCS.create` argument
module
is renamed tomodules
and can also be a list of modules to enable for the WCS cluster. The argument can be used on the PROD WCS too. The :meth:`~weaviate.wcs.WCS.get_cluster_config` does not raise an exception if the cluster does not exist but returns a empty configuration.
The :meth:`~weaviate.wcs.WCS.delete_cluster` does not raise an exception if the cluster does not exist.
Add
phoneNumber
to the Weaviate's primitive types. Thanks to GitHub user @cdpierse.Bug fix in :class:`~weaviate.connect.Connection`.
Fix
ConnectionError
handling.Optimization in
weaviate.batch.requests
andweaviate.connect.connection
.
weaviate.tools
module is REMOVED.Batcher
class is REMOVED.WCS
class is moved from theweaviate.tools
to the new moduleweaviate.wcs
weaviate.tools.generate_uuid
is REMOVED.
:func:`weaviate.util.generate_uuid5` is ADDED.
- New :class:`~weaviate.batch.Batch` class implementation to replace the old one. This implementation uses the
BatchRequest
objects 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 the :class:`~weaviate.batch.Batch` documentation for more information. BatchRequest
classes (ObjectsBatchRequest
andReferenceBatchRequest
) are hidden from the user and should not be used anymore. This is due to the new :class:`~weaviate.batch.Batch` class implementation.- New :class:`~weaviate.schema.Schema` field is ADDED, "shardingConfig". It can bu used with Weaviate version >= 1.6.0.
- New method :meth:`~weaviate.schema.Schema.update_config` used to update mutable schema configuration (like efConstruction, ...).