{"record":{"id":"4fd45fefd5403447","repo":"microsoft/qlib","slug":"please-implement-the-list-experiments-method","errorCode":null,"errorMessage":"Please implement the `list_experiments` method.","messagePattern":"Please implement the `list_experiments` method\\.","errorType":"exception","errorClass":"NotImplementedError","httpStatus":null,"severity":"error","filePath":"qlib/workflow/expm.py","lineNumber":314,"sourceCode":"    def uri(self):\n        \"\"\"\n        Get the default tracking URI or current URI.\n\n        Returns\n        -------\n        The tracking URI string.\n        \"\"\"\n        return self._active_exp_uri or self.default_uri\n\n    def list_experiments(self):\n        \"\"\"\n        List all the existing experiments.\n\n        Returns\n        -------\n        A dictionary (name -> experiment) of experiments information that being stored.\n        \"\"\"\n        raise NotImplementedError(f\"Please implement the `list_experiments` method.\")\n\n\nclass MLflowExpManager(ExpManager):\n    \"\"\"\n    Use mlflow to implement ExpManager.\n    \"\"\"\n\n    @property\n    def client(self):\n        # Please refer to `tests/dependency_tests/test_mlflow.py::MLflowTest::test_creating_client`\n        # The test ensure the speed of create a new client\n        return mlflow.tracking.MlflowClient(tracking_uri=self.uri)\n\n    def _start_exp(\n        self,\n        *,\n        experiment_id: Optional[Text] = None,\n        experiment_name: Optional[Text] = None,","sourceCodeStart":296,"sourceCodeEnd":332,"githubUrl":"https://github.com/microsoft/qlib/blob/79633dd9506ea689e5400dea0197717b5b3d74b7/qlib/workflow/expm.py#L296-L332","documentation":"ExpManager.list_experiments is an abstract method that must return a dict (name -> Experiment) of stored experiments; the base class body raises NotImplementedError. MLflowExpManager implements it by searching the tracking store. The error means an abstract or partial manager was asked to enumerate experiments.","triggerScenarios":"R.list_experiments() when C['exp_manager']['class'] points to the base ExpManager or a custom subclass without the override; direct exp_manager.list_experiments() in tests.","commonSituations":"Custom tracking managers that support running experiments but not enumeration; onboarding scripts that list experiments before finishing a custom backend.","solutions":["Use the default MLflowExpManager (qlib.init defaults) so listing works.","Implement list_experiments(self) in your subclass returning {name: Experiment}.","Interim workaround: query the backend natively (e.g. MlflowClient.search_experiments)."],"exampleFix":"# before\nExpManager().list_experiments()  # NotImplementedError\n\n# after\nexps = R.list_experiments()  # {'alpha158': MLflowExperiment(...), ...}","handlingStrategy":"type-guard","validationCode":"from qlib.workflow.expm import ExpManager\nassert R.exp_manager.__class__.list_experiments is not ExpManager.list_experiments, 'listing unsupported'","typeGuard":"def manager_can_list(mgr) -> bool:\n    from qlib.workflow.expm import ExpManager\n    return mgr.__class__.list_experiments is not ExpManager.list_experiments","tryCatchPattern":null,"preventionTips":["Enumerate experiments via R.list_experiments() under the default manager.","Finish custom backends' enumeration support before relying on it in dashboards."],"tags":["qlib","abstract-method","not-implemented","exp-manager","listing"],"backgroundTag":null,"analyzedSha":"79633dd9506ea689e5400dea0197717b5b3d74b7","analyzedAt":"2026-08-15T07:01:27.511Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}