Skip to content

Commit

Permalink
[OPIK-390]: run linter;
Browse files Browse the repository at this point in the history
  • Loading branch information
Sasha committed Nov 13, 2024
1 parent 3a94777 commit 3b8de25
Showing 1 changed file with 13 additions and 8 deletions.
21 changes: 13 additions & 8 deletions sdks/python/src/opik/url_helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -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") + "/"


Expand All @@ -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)


Expand Down

0 comments on commit 3b8de25

Please sign in to comment.