diff --git a/mlflow_export_import/client/http_client.py b/mlflow_export_import/client/http_client.py index 475bb29d..5c0c7119 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 diff --git a/mlflow_export_import/common/logging_utils.py b/mlflow_export_import/common/logging_utils.py index b656d870..2a6768bb 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