From 8974c606f13b1c781f9743818d5434ce7ce23b01 Mon Sep 17 00:00:00 2001 From: y0z Date: Fri, 18 Oct 2024 12:51:04 +0900 Subject: [PATCH 1/4] Fix for mypy. --- optuna_integration/mlflow/mlflow.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/optuna_integration/mlflow/mlflow.py b/optuna_integration/mlflow/mlflow.py index 431f7fee..197e8264 100644 --- a/optuna_integration/mlflow/mlflow.py +++ b/optuna_integration/mlflow/mlflow.py @@ -153,7 +153,7 @@ def wrapper(trial: optuna.trial.Trial) -> float | Sequence[float]: with self._lock: study = trial.study self._initialize_experiment(study) - nested = self._mlflow_kwargs.get("nested") + nested = bool(self._mlflow_kwargs.get("nested")) run_name = self._mlflow_kwargs.get("run_name", str(trial.number)) with mlflow.start_run(run_name=run_name, nested=nested) as run: From 8f1ecbd579c438177cba8552be30500e7a250413 Mon Sep 17 00:00:00 2001 From: y0z Date: Fri, 18 Oct 2024 12:57:32 +0900 Subject: [PATCH 2/4] Increase len(my_user_attr) limit to 8000. --- tests/mlflow/test_mlflow.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/mlflow/test_mlflow.py b/tests/mlflow/test_mlflow.py index c9992409..d64ea977 100644 --- a/tests/mlflow/test_mlflow.py +++ b/tests/mlflow/test_mlflow.py @@ -235,7 +235,7 @@ def test_tag_truncation(tmpdir: py.path.local) -> None: first_run_dict = first_run.to_dictionary() my_user_attr = first_run_dict["data"]["tags"]["my_user_attr"] - assert len(my_user_attr) <= 5000 + assert len(my_user_attr) <= 8000 def test_nest_trials(tmpdir: py.path.local) -> None: From 47e096537d49dee15658d54d465ecb74ad3c92ff Mon Sep 17 00:00:00 2001 From: y0z Date: Fri, 18 Oct 2024 13:09:10 +0900 Subject: [PATCH 3/4] Fix for CI. --- tests/mlflow/test_mlflow.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/mlflow/test_mlflow.py b/tests/mlflow/test_mlflow.py index d64ea977..5651c2bf 100644 --- a/tests/mlflow/test_mlflow.py +++ b/tests/mlflow/test_mlflow.py @@ -127,7 +127,7 @@ def test_use_existing_experiment_by_id(tmpdir: py.path.local) -> None: assert experiment.experiment_id == experiment_id assert experiment.name == "foo" - runs = mlfl_client.search_runs(experiment_id) + runs = mlfl_client.search_runs(experiment_id) # type: ignore assert len(runs) == 10 From 9258f2bdb4356313135361e36c4b649a7fa69d39 Mon Sep 17 00:00:00 2001 From: Yoshihiko Ozaki <30489874+y0z@users.noreply.github.com> Date: Fri, 18 Oct 2024 15:59:14 +0900 Subject: [PATCH 4/4] Update tests/mlflow/test_mlflow.py Co-authored-by: Shuhei Watanabe <47781922+nabenabe0928@users.noreply.github.com> --- tests/mlflow/test_mlflow.py | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/mlflow/test_mlflow.py b/tests/mlflow/test_mlflow.py index 5651c2bf..0082fd19 100644 --- a/tests/mlflow/test_mlflow.py +++ b/tests/mlflow/test_mlflow.py @@ -127,6 +127,7 @@ def test_use_existing_experiment_by_id(tmpdir: py.path.local) -> None: assert experiment.experiment_id == experiment_id assert experiment.name == "foo" + # TODO(y0z): Remove type ignore once the MLFlow typing is fixed. runs = mlfl_client.search_runs(experiment_id) # type: ignore assert len(runs) == 10