From 1fa4d9577948762a23305957459d3c26cc3056ce Mon Sep 17 00:00:00 2001 From: flmeyer Date: Mon, 8 Jul 2024 10:20:47 +0200 Subject: [PATCH 1/2] Fix url joining --- mlflow_export_import/client/http_client.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mlflow_export_import/client/http_client.py b/mlflow_export_import/client/http_client.py index 475bb29..5c0c711 100644 --- a/mlflow_export_import/client/http_client.py +++ b/mlflow_export_import/client/http_client.py @@ -1,7 +1,7 @@ from abc import abstractmethod, ABCMeta -import os import json import requests +from urllib.parse import urljoin import click from mlflow_export_import.common import MlflowExportImportException from . import USER_AGENT @@ -94,7 +94,7 @@ def __init__(self, api_name, host=None, token=None): http_status_code=401 ) self.host = host - self.api_uri = os.path.join(host, api_name) + self.api_uri = urljoin(host, api_name) self.token = token From 3fd99b674cfd880cd8b7a3315b73b88c512bd00e Mon Sep 17 00:00:00 2001 From: flmeyer Date: Mon, 8 Jul 2024 10:21:21 +0200 Subject: [PATCH 2/2] Fix missing file_handler directory --- mlflow_export_import/common/logging_utils.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/mlflow_export_import/common/logging_utils.py b/mlflow_export_import/common/logging_utils.py index b656d87..2a6768b 100644 --- a/mlflow_export_import/common/logging_utils.py +++ b/mlflow_export_import/common/logging_utils.py @@ -55,4 +55,6 @@ def _create_default_log_config(output_path=None, log_format=None): handlers = cfg["root"]["handlers"] handlers.remove("file") + os.makedirs(os.path.dirname(cfg["handlers"]["file"]["filename"]), exist_ok=True) + return cfg