Skip to content

Commit fd7f6f7

Browse files
author
Valentin Thorey
committed
Give MLflowHandle the ability to reload artifact_repository_registry
1 parent c670853 commit fd7f6f7

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

dataikuapi/dss_plugin_mlflow/utils.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,14 @@ def __init__(self, client, project_key, managed_folder="mlflow_artifacts", host=
3737
)
3838
sys.path.insert(0, self.tempdir)
3939

40+
# Reload the artifact_repository_registry in case MLflow was imported beforehand
41+
import mlflow
42+
try: # python 3.4+
43+
from importlib import reload
44+
except ImportError:
45+
pass
46+
reload(mlflow.store.artifact.artifact_repository_registry)
47+
4048
# Setup authentication
4149
if client._session.auth is not None:
4250
self.mlflow_env.update({

0 commit comments

Comments
 (0)