From 3b8de25c497b6d31d3f30edfefde2ba445daa810 Mon Sep 17 00:00:00 2001 From: Sasha Date: Wed, 13 Nov 2024 10:09:41 +0100 Subject: [PATCH] [OPIK-390]: run linter; --- sdks/python/src/opik/url_helpers.py | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/sdks/python/src/opik/url_helpers.py b/sdks/python/src/opik/url_helpers.py index 99fbe887a..78fb76b26 100644 --- a/sdks/python/src/opik/url_helpers.py +++ b/sdks/python/src/opik/url_helpers.py @@ -12,7 +12,7 @@ def get_ui_url() -> str: config = opik.config.OpikConfig() opik_url_override = config.url_override - + return opik_url_override.rstrip("/api") + "/" @@ -27,25 +27,30 @@ def get_experiment_url(dataset_name: str, experiment_id: str) -> str: config = opik.config.OpikConfig() ui_url = get_ui_url() - - experiment_path = urllib.parse.quote(f"{config.workspace}/experiments/{dataset_id}/compare?experiments=[\"{experiment_id}\"]", safe=ALLOWED_URL_CHARACTERS) - - return urllib.parse.urljoin(ui_url, experiment_path) + experiment_path = urllib.parse.quote( + f'{config.workspace}/experiments/{dataset_id}/compare?experiments=["{experiment_id}"]', + safe=ALLOWED_URL_CHARACTERS, + ) + + return urllib.parse.urljoin(ui_url, experiment_path) def get_projects_url(workspace: str) -> str: ui_url = get_ui_url() - + projects_path = "{workspace}/projects" - + return urllib.parse.urljoin(ui_url, projects_path) def get_project_url(workspace: str, project_name: str) -> str: ui_url = get_ui_url() - project_path = urllib.parse.quote(f"{workspace}/redirect/projects?name={project_name}", safe=ALLOWED_URL_CHARACTERS) + project_path = urllib.parse.quote( + f"{workspace}/redirect/projects?name={project_name}", + safe=ALLOWED_URL_CHARACTERS, + ) return urllib.parse.urljoin(ui_url, project_path)