From c66932c1e767b28d4d72e5784f0ab6dd4d24c23d Mon Sep 17 00:00:00 2001 From: Eddy Comyn-Platt <53045993+EddyCMWF@users.noreply.github.com> Date: Thu, 3 Oct 2024 16:37:43 +0100 Subject: [PATCH 1/3] Update legacy_api_client.py --- cads_api_client/legacy_api_client.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cads_api_client/legacy_api_client.py b/cads_api_client/legacy_api_client.py index bbc03ea..a140dcd 100644 --- a/cads_api_client/legacy_api_client.py +++ b/cads_api_client/legacy_api_client.py @@ -135,7 +135,7 @@ def __init__( @classmethod def raise_not_implemented_error(self) -> None: raise NotImplementedError( - "This is a beta version. This functionality has not been implemented yet." + "This functionality is no longer supported." ) def logging_decorator(self, func: F) -> F: From 7bae57272ab45971b8f68cf7407d12f401d9c8c0 Mon Sep 17 00:00:00 2001 From: malmans2 Date: Fri, 18 Oct 2024 10:43:32 +0200 Subject: [PATCH 2/3] qa --- cads_api_client/legacy_api_client.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/cads_api_client/legacy_api_client.py b/cads_api_client/legacy_api_client.py index e2923b7..a9c054c 100644 --- a/cads_api_client/legacy_api_client.py +++ b/cads_api_client/legacy_api_client.py @@ -134,9 +134,7 @@ def issue_deprecated_kwargs_warning(self, **kwargs: Any) -> None: @classmethod def raise_not_implemented_error(self) -> None: - raise NotImplementedError( - "This functionality is no longer supported." - ) + raise NotImplementedError("This functionality is no longer supported.") @overload def retrieve(self, name: str, request: dict[str, Any], target: str) -> str: ... From 7d45e96badf8c9148656423f8805cd9c97acd4a8 Mon Sep 17 00:00:00 2001 From: malmans2 Date: Mon, 21 Oct 2024 11:07:43 +0200 Subject: [PATCH 3/3] edit message --- cads_api_client/legacy_api_client.py | 17 +++++++++++------ tests/integration_test_70_legacy_api_client.py | 7 +++++++ 2 files changed, 18 insertions(+), 6 deletions(-) diff --git a/cads_api_client/legacy_api_client.py b/cads_api_client/legacy_api_client.py index a9c054c..ed82808 100644 --- a/cads_api_client/legacy_api_client.py +++ b/cads_api_client/legacy_api_client.py @@ -133,8 +133,11 @@ def issue_deprecated_kwargs_warning(self, **kwargs: Any) -> None: ) @classmethod - def raise_not_implemented_error(self) -> None: - raise NotImplementedError("This functionality is no longer supported.") + def raise_toolbox_error(self) -> None: + raise NotImplementedError( + "Legacy CDS Toolbox is now discontinued." + " Watch for announcements/updates on new CDS improved capabilities on our Forum (https://forum.ecmwf.int/)." + ) @overload def retrieve(self, name: str, request: dict[str, Any], target: str) -> str: ... @@ -188,11 +191,13 @@ def error(self, *args: Any, **kwargs: Any) -> None: def debug(self, *args: Any, **kwargs: Any) -> None: self.log(logging.DEBUG, *args, **kwargs) - def service(self, name, *args, **kwargs): # type: ignore - self.raise_not_implemented_error() + @typing.no_type_check + def service(self, name, *args, **kwargs): + self.raise_toolbox_error() - def workflow(self, code, *args, **kwargs): # type: ignore - self.raise_not_implemented_error() + @typing.no_type_check + def workflow(self, code, *args, **kwargs): + self.raise_toolbox_error() def status(self, context: Any = None) -> dict[str, list[str]]: status = collections.defaultdict(list) diff --git a/tests/integration_test_70_legacy_api_client.py b/tests/integration_test_70_legacy_api_client.py index d8355d8..9ea8e03 100644 --- a/tests/integration_test_70_legacy_api_client.py +++ b/tests/integration_test_70_legacy_api_client.py @@ -305,3 +305,10 @@ def test_legacy_api_client_warning( metadata="b", # type: ignore[arg-type] forget="c", # type: ignore[arg-type] ) + + +def test_legacy_api_client_toolbox(legacy_client: LegacyApiClient) -> None: + with pytest.raises(NotImplementedError): + legacy_client.service("service") + with pytest.raises(NotImplementedError): + legacy_client.workflow("workflow")