From 9423d4a608507f1074cbd1f5def05cc3f5501ab2 Mon Sep 17 00:00:00 2001 From: ThibaultFy <50656860+ThibaultFy@users.noreply.github.com> Date: Mon, 22 Apr 2024 17:14:40 +0200 Subject: [PATCH] chore: add warning in hybrid mode (#413) Signed-off-by: ThibaultFy --- changes/413.added | 1 + substra/sdk/client.py | 4 ++++ 2 files changed, 5 insertions(+) create mode 100644 changes/413.added diff --git a/changes/413.added b/changes/413.added new file mode 100644 index 00000000..2572d1a1 --- /dev/null +++ b/changes/413.added @@ -0,0 +1 @@ +A warning indicates when a `Client` is set in hybrid mode \ No newline at end of file diff --git a/substra/sdk/client.py b/substra/sdk/client.py index 074b1686..9951dcf3 100644 --- a/substra/sdk/client.py +++ b/substra/sdk/client.py @@ -343,6 +343,10 @@ def _get_backend(self, backend_type: schemas.BackendType): if backend_type in [schemas.BackendType.LOCAL_DOCKER, schemas.BackendType.LOCAL_SUBPROCESS]: backend = None if self._url: + logger.warning( + f"Backend mode {backend_type} given with a URL is a hybrid mode. The client will connect to the " + "platform in read-only." + ) backend = backends.get( schemas.BackendType.REMOTE, url=self._url,