From bb48a19e9a8eb8a353b3fee88c35cbe5da43f9d4 Mon Sep 17 00:00:00 2001 From: Dirk Kulawiak Date: Wed, 14 Aug 2024 09:18:22 +0200 Subject: [PATCH 1/5] Remove copy of v3 in v4 --- weaviate/warnings.py | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/weaviate/warnings.py b/weaviate/warnings.py index 6218f1350..1b8c34258 100644 --- a/weaviate/warnings.py +++ b/weaviate/warnings.py @@ -160,12 +160,14 @@ def root_module_import(name: str, loc: str) -> None: @staticmethod def weaviate_v3_client_is_deprecated() -> None: warnings.warn( - message="""Dep016: Python client v3 `weaviate.Client(...)` connections and methods are deprecated. Update - your code to use Python client v4 `weaviate.WeaviateClient` connections and methods. - - For Python Client v4 usage, see: https://weaviate.io/developers/weaviate/client-libraries/python - For code migration, see: https://weaviate.io/developers/weaviate/client-libraries/python/v3_v4_migration - """, + message="""Dep016: Python client v3 `weaviate.Client(...)` connections and methods are deprecated and will + be removed by 31.11.2024. + + You can either: + a) upgrade your code to use Python client v4 `weaviate.WeaviateClient` connections and methods. + - For Python Client v4 usage, see: https://weaviate.io/developers/weaviate/client-libraries/python + - For code migration, see: https://weaviate.io/developers/weaviate/client-libraries/python/v3_v4_migration + b) stay on v3 releases by installing `weaviate-client==3.26.X` and/or pin the dependency in your requirement file using `weaviate-client>=3.26.6;<4.0.0`""", category=DeprecationWarning, stacklevel=1, ) From 09d592d3fd238a03025cbb02b737be79735e19ca Mon Sep 17 00:00:00 2001 From: Dirk Kulawiak Date: Wed, 14 Aug 2024 09:22:09 +0200 Subject: [PATCH 2/5] Add version support into readme --- README.rst | 10 +++++++++- weaviate/warnings.py | 2 +- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/README.rst b/README.rst index a66eeb41c..c3a1a8c5f 100644 --- a/README.rst +++ b/README.rst @@ -23,6 +23,15 @@ The client is tested for python 3.8 and higher. Visit the official `Weaviate `_ website for more information about the Weaviate and how to use it in production. +Client Versions +-------- +We currently support the following versions client versions: + +- 4.X: actively supported +- 3.X: deprecated, receives only critical bug fixes and dependency updates +- copy of the 3.X branch in v4 releases: Will be removed at 30.11.2024 + + Articles -------- @@ -32,7 +41,6 @@ Here are some articles on Weaviate: - `Getting Started with Weaviate Python Library `_ - `A sub-50ms neural search with DistilBERT and Weaviate `_ - Documentation ------------- diff --git a/weaviate/warnings.py b/weaviate/warnings.py index 1b8c34258..f8e2368ab 100644 --- a/weaviate/warnings.py +++ b/weaviate/warnings.py @@ -161,7 +161,7 @@ def root_module_import(name: str, loc: str) -> None: def weaviate_v3_client_is_deprecated() -> None: warnings.warn( message="""Dep016: Python client v3 `weaviate.Client(...)` connections and methods are deprecated and will - be removed by 31.11.2024. + be removed by 30.11.2024. You can either: a) upgrade your code to use Python client v4 `weaviate.WeaviateClient` connections and methods. From f4b9995762b400a3c836f55c0901a839e8a26f4f Mon Sep 17 00:00:00 2001 From: Dirk Kulawiak Date: Thu, 15 Aug 2024 16:23:44 +0200 Subject: [PATCH 3/5] Update text after review --- README.rst | 2 +- weaviate/client.py | 21 ++++++++++++++------- weaviate/warnings.py | 8 ++++---- 3 files changed, 19 insertions(+), 12 deletions(-) diff --git a/README.rst b/README.rst index c3a1a8c5f..96e42e55c 100644 --- a/README.rst +++ b/README.rst @@ -29,7 +29,7 @@ We currently support the following versions client versions: - 4.X: actively supported - 3.X: deprecated, receives only critical bug fixes and dependency updates -- copy of the 3.X branch in v4 releases: Will be removed at 30.11.2024 +- copy of the 3.X branch in v4 releases: Will be removed on 2024-11-30 Articles diff --git a/weaviate/client.py b/weaviate/client.py index 39269e3df..1c4bcb8d5 100644 --- a/weaviate/client.py +++ b/weaviate/client.py @@ -7,23 +7,22 @@ from httpx import HTTPError as HttpxError from requests.exceptions import ConnectionError as RequestsConnectionError +from typing_extensions import deprecated +from weaviate import syncify from weaviate.backup.backup import _BackupAsync from weaviate.backup.sync import _Backup - - -from weaviate import syncify +from weaviate.event_loop import _EventLoopSingleton, _EventLoop from .auth import AuthCredentials from .backup import Backup from .batch import Batch from .classification import Classification - from .client_base import _WeaviateClientBase from .cluster import Cluster -from .collections.collections.async_ import _CollectionsAsync -from .collections.collections.sync import _Collections from .collections.batch.client import _BatchClientWrapper from .collections.cluster import _Cluster, _ClusterAsync +from .collections.collections.async_ import _CollectionsAsync +from .collections.collections.sync import _Collections from .config import AdditionalConfig, Config from .connect import Connection from .connect.base import ( @@ -40,7 +39,6 @@ ) from .gql import Query from .schema import Schema -from weaviate.event_loop import _EventLoopSingleton, _EventLoop from .types import NUMBER from .util import _get_valid_timeout_config, _type_request_response from .warnings import _Warnings @@ -175,6 +173,15 @@ async def __aexit__(self, exc_type: Any, exc_value: Any, traceback: Any) -> None await self.close() +@deprecated(""" +Python client v3 `weaviate.Client(...)` connections and methods are deprecated and will + be removed by 2024-11-30. + + Upgrade your code to use Python client v4 `weaviate.WeaviateClient` connections and methods. + - For Python Client v4 usage, see: https://weaviate.io/developers/weaviate/client-libraries/python + - For code migration, see: https://weaviate.io/developers/weaviate/client-libraries/python/v3_v4_migration + + If you have to use v3 code, install the v3 client and pin the v3 dependency in your requirements file: `weaviate-client>=3.26.7;<4.0.0`""") class Client: """ The v3 Python-native Weaviate Client class that encapsulates Weaviate functionalities in one object. diff --git a/weaviate/warnings.py b/weaviate/warnings.py index f8e2368ab..c17dfc055 100644 --- a/weaviate/warnings.py +++ b/weaviate/warnings.py @@ -161,13 +161,13 @@ def root_module_import(name: str, loc: str) -> None: def weaviate_v3_client_is_deprecated() -> None: warnings.warn( message="""Dep016: Python client v3 `weaviate.Client(...)` connections and methods are deprecated and will - be removed by 30.11.2024. + be removed by 2024-11-30. - You can either: - a) upgrade your code to use Python client v4 `weaviate.WeaviateClient` connections and methods. + Upgrade your code to use Python client v4 `weaviate.WeaviateClient` connections and methods. - For Python Client v4 usage, see: https://weaviate.io/developers/weaviate/client-libraries/python - For code migration, see: https://weaviate.io/developers/weaviate/client-libraries/python/v3_v4_migration - b) stay on v3 releases by installing `weaviate-client==3.26.X` and/or pin the dependency in your requirement file using `weaviate-client>=3.26.6;<4.0.0`""", + + If you have to use v3 code, install the v3 client and pin the v3 dependency in your requirements file: `weaviate-client>=3.26.7;<4.0.0`""", category=DeprecationWarning, stacklevel=1, ) From 2c580390786b9589c076e45e23c2ad17e784cc76 Mon Sep 17 00:00:00 2001 From: Dirk Kulawiak Date: Thu, 15 Aug 2024 16:27:50 +0200 Subject: [PATCH 4/5] Formating --- weaviate/client.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/weaviate/client.py b/weaviate/client.py index 1c4bcb8d5..960607fac 100644 --- a/weaviate/client.py +++ b/weaviate/client.py @@ -173,7 +173,8 @@ async def __aexit__(self, exc_type: Any, exc_value: Any, traceback: Any) -> None await self.close() -@deprecated(""" +@deprecated( + """ Python client v3 `weaviate.Client(...)` connections and methods are deprecated and will be removed by 2024-11-30. @@ -181,7 +182,8 @@ async def __aexit__(self, exc_type: Any, exc_value: Any, traceback: Any) -> None - For Python Client v4 usage, see: https://weaviate.io/developers/weaviate/client-libraries/python - For code migration, see: https://weaviate.io/developers/weaviate/client-libraries/python/v3_v4_migration - If you have to use v3 code, install the v3 client and pin the v3 dependency in your requirements file: `weaviate-client>=3.26.7;<4.0.0`""") + If you have to use v3 code, install the v3 client and pin the v3 dependency in your requirements file: `weaviate-client>=3.26.7;<4.0.0`""" +) class Client: """ The v3 Python-native Weaviate Client class that encapsulates Weaviate functionalities in one object. From d2c61b608ddecea0279c3e698d6ea65fb9b2f313 Mon Sep 17 00:00:00 2001 From: Tommy Smith Date: Fri, 30 Aug 2024 17:15:34 +0100 Subject: [PATCH 5/5] Fix formatter --- README.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.rst b/README.rst index 96e42e55c..5bcc2a759 100644 --- a/README.rst +++ b/README.rst @@ -24,7 +24,7 @@ The client is tested for python 3.8 and higher. Visit the official `Weaviate `_ website for more information about the Weaviate and how to use it in production. Client Versions --------- +--------------- We currently support the following versions client versions: - 4.X: actively supported