1
0
mirror of https://github.com/microsoft/qlib.git synced 2026-07-06 04:20:57 +08:00

Set _artifact_uri when mlflow_run is not None. (#1367)

* Set _artifact_uri when mlflow_run is not None.

* Fix black.
This commit is contained in:
Chia-hung Tai
2022-11-19 11:56:30 +08:00
committed by GitHub
parent e47b0f1c50
commit 0c4db8b0f8
2 changed files with 30 additions and 0 deletions

View File

@@ -279,6 +279,7 @@ class MLflowRecorder(Recorder):
if mlflow_run.info.end_time is not None
else None
)
self._artifact_uri = mlflow_run.info.artifact_uri
self.async_log = None
def __repr__(self):

29
tests/test_workflow.py Normal file
View File

@@ -0,0 +1,29 @@
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
import unittest
from pathlib import Path
import shutil
from qlib.workflow import R
from qlib.tests import TestAutoData
class WorkflowTest(TestAutoData):
TMP_PATH = Path("./.mlruns_tmp/")
def tearDown(self) -> None:
if self.TMP_PATH.exists():
shutil.rmtree(self.TMP_PATH)
def test_get_local_dir(self):
""" """
with R.start(uri=str(self.TMP_PATH)):
pass
with R.uri_context(uri=str(self.TMP_PATH)):
resume_recorder = R.get_recorder()
resume_recorder.get_local_dir()
if __name__ == "__main__":
unittest.main()