diff --git a/qlib/workflow/expm.py b/qlib/workflow/expm.py index b68e2e0b81..027d817dd7 100644 --- a/qlib/workflow/expm.py +++ b/qlib/workflow/expm.py @@ -422,11 +422,11 @@ def delete_exp(self, experiment_id=None, experiment_name=None): def list_experiments(self): # retrieve all the existing experiments - mlflow_version = int(mlflow.__version__.split(".")[0]) + mlflow_version = int(mlflow.__version__.split('.', maxsplit=1)[0]) if mlflow_version >= 2: exps = self.client.search_experiments(view_type=ViewType.ACTIVE_ONLY) else: - exps = self.client.list_experiments(view_type=ViewType.ACTIVE_ONLY) + exps = self.client.list_experiments(view_type=ViewType.ACTIVE_ONLY) # pylint: disable=E1101 experiments = dict() for exp in exps: experiment = MLflowExperiment(exp.experiment_id, exp.name, self.uri)