From 5592e04d152aa17aa221a17a41d3ade75a7dba58 Mon Sep 17 00:00:00 2001 From: lbarber Date: Thu, 20 Jul 2023 16:42:33 -0400 Subject: [PATCH] chore: resolved mypy errors with experiment endpoint --- src/dioptra/client/_client.py | 53 +++++++++++++++++++++++++++++------ 1 file changed, 44 insertions(+), 9 deletions(-) diff --git a/src/dioptra/client/_client.py b/src/dioptra/client/_client.py index 3fd3306fd..6e8eb2262 100644 --- a/src/dioptra/client/_client.py +++ b/src/dioptra/client/_client.py @@ -74,7 +74,7 @@ def __init__( tasks_plugins, custom_task_plugins, builtin_task_plugins, - ): + ) -> None: self._session = session self._experiment = experiment self._job = job @@ -148,7 +148,14 @@ def session(self): def experiment_endpoint(self) -> str: """Experiment endpoint url""" return urlunparse( - (self._scheme, self._netloc, urljoin(self._path, "experiment/"), "", "", "") + ( + str(self._scheme), + str(self._netloc), + urljoin(str(self._path), "experiment/"), + "", + "", + "", + ) ) def set_session(self, session: requests.Session): @@ -303,7 +310,14 @@ def session(self): def job_endpoint(self) -> str: """Job endpoint url""" return urlunparse( - (self._scheme, self._netloc, urljoin(self._path, "job/"), "", "", "") + ( + str(self._scheme), + str(self._netloc), + urljoin(str(self._path), "job/"), + "", + "", + "", + ) ) def set_session(self, session: requests.Session): @@ -490,7 +504,14 @@ def session(self): def task_plugin_endpoint(self) -> str: """Task plugins endpoint url""" return urlunparse( - (self._scheme, self._netloc, urljoin(self._path, "taskPlugin/"), "", "", "") + ( + str(self._scheme), + str(self._netloc), + urljoin(str(self._path), "taskPlugin/"), + "", + "", + "", + ) ) def set_session(self, session: requests.Session): @@ -562,9 +583,9 @@ def task_plugin_builtins_endpoint(self) -> str: """Builtin task plugins endpoint url""" return urlunparse( ( - self._scheme, - self._netloc, - urljoin(self._path, "taskPlugin/dioptra_builtins"), + str(self._scheme), + str(self._netloc), + urljoin(str(self._path), "taskPlugin/dioptra_builtins"), "", "", "", @@ -679,7 +700,14 @@ def task_plugin_custom_endpoint(self) -> str: def task_plugin_endpoint(self) -> str: """Task plugins endpoint url""" return urlunparse( - (self._scheme, self._netloc, urljoin(self._path, "taskPlugin/"), "", "", "") + ( + str(self._scheme), + str(self._netloc), + urljoin(str(self._path), "taskPlugin/"), + "", + "", + "", + ) ) def set_session(self, session: requests.Session): @@ -869,7 +897,14 @@ def session(self): def queue_endpoint(self) -> str: """Queue endpoint url""" return urlunparse( - (self._scheme, self._netloc, urljoin(self._path, "queue/"), "", "", "") + ( + str(self._scheme), + str(self._netloc), + urljoin(str(self._path), "queue/"), + "", + "", + "", + ) ) def set_session(self, session: requests.Session):