From 5fd6293b889ce09766028b8f69cdee519533ab35 Mon Sep 17 00:00:00 2001 From: Tommy Smith Date: Thu, 6 Jun 2024 15:50:42 +0100 Subject: [PATCH] Export submodules to ease usage of `weaviate.outputs` - Also required were a number of seemingly irrelevant pyright fixes due to change in version number on `main` --- weaviate/collections/classes/cluster.py | 5 ++++- weaviate/collections/grpc/query.py | 2 +- weaviate/conftest.py | 2 +- weaviate/outputs/__init__.py | 3 +++ 4 files changed, 9 insertions(+), 3 deletions(-) diff --git a/weaviate/collections/classes/cluster.py b/weaviate/collections/classes/cluster.py index b73224352..0fe533392 100644 --- a/weaviate/collections/classes/cluster.py +++ b/weaviate/collections/classes/cluster.py @@ -73,7 +73,10 @@ def nodes_verbose(nodes: List[NodeREST]) -> List[Node[Shards, Stats]]: shard_count=node["stats"]["shardCount"], ) if "stats" in node - else [] + else Stats( + object_count=0, + shard_count=0, + ) ), status=node["status"], version=node["version"], diff --git a/weaviate/collections/grpc/query.py b/weaviate/collections/grpc/query.py index 1ddd83747..1fe9e5e6e 100644 --- a/weaviate/collections/grpc/query.py +++ b/weaviate/collections/grpc/query.py @@ -118,7 +118,7 @@ def get( _validate_input(_ValidateArgument([_Sorting, None], "sort", sort)) if sort is not None: - sort_by: grpc.RepeatedCompositeFieldContainer[search_get_pb2.SortBy] = [ + sort_by = [ search_get_pb2.SortBy(ascending=sort.ascending, path=[sort.prop]) for sort in sort.sorts ] diff --git a/weaviate/conftest.py b/weaviate/conftest.py index 31caa0804..1f3c29999 100644 --- a/weaviate/conftest.py +++ b/weaviate/conftest.py @@ -10,4 +10,4 @@ def _split_scope(self, nodeid: str) -> str: def pytest_xdist_make_scheduler(config: object, log: object) -> MyScheduler: - return MyScheduler(config, log) + return MyScheduler(config, log) # pyright: ignore diff --git a/weaviate/outputs/__init__.py b/weaviate/outputs/__init__.py index e69de29bb..88b6b2c0d 100644 --- a/weaviate/outputs/__init__.py +++ b/weaviate/outputs/__init__.py @@ -0,0 +1,3 @@ +from . import aggregate, backup, batch, cluster, config, data, query, tenants + +__all__ = ["aggregate", "backup", "batch", "cluster", "config", "data", "query", "tenants"]