microsoft/qlib · error · NotImplementedError
Please implement the `list_experiments` method.
Error message
Please implement the `list_experiments` method.
What it means
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.
Source
Thrown at qlib/workflow/expm.py:314
def uri(self):
"""
Get the default tracking URI or current URI.
Returns
-------
The tracking URI string.
"""
return self._active_exp_uri or self.default_uri
def list_experiments(self):
"""
List all the existing experiments.
Returns
-------
A dictionary (name -> experiment) of experiments information that being stored.
"""
raise NotImplementedError(f"Please implement the `list_experiments` method.")
class MLflowExpManager(ExpManager):
"""
Use mlflow to implement ExpManager.
"""
@property
def client(self):
# Please refer to `tests/dependency_tests/test_mlflow.py::MLflowTest::test_creating_client`
# The test ensure the speed of create a new client
return mlflow.tracking.MlflowClient(tracking_uri=self.uri)
def _start_exp(
self,
*,
experiment_id: Optional[Text] = None,
experiment_name: Optional[Text] = None,View on GitHub (pinned to 79633dd950)
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).
Example fix
# before
ExpManager().list_experiments() # NotImplementedError
# after
exps = R.list_experiments() # {'alpha158': MLflowExperiment(...), ...} Defensive patterns
Strategy: type-guard
Validate before calling
from qlib.workflow.expm import ExpManager assert R.exp_manager.__class__.list_experiments is not ExpManager.list_experiments, 'listing unsupported'
Type guard
def manager_can_list(mgr) -> bool:
from qlib.workflow.expm import ExpManager
return mgr.__class__.list_experiments is not ExpManager.list_experiments Prevention
- Enumerate experiments via R.list_experiments() under the default manager.
- Finish custom backends' enumeration support before relying on it in dashboards.
When it happens
Trigger: 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.
Common situations: Custom tracking managers that support running experiments but not enumeration; onboarding scripts that list experiments before finishing a custom backend.
Related errors
- Please implement the `list_recorders` method.
- Please implement the `start_exp` method.
- Please implement the `end_exp` method.
- Please implement the `create_exp` method.
- Please implement the `search_records` method.
AI-assisted analysis of microsoft/qlib@79633dd950 (2026-08-15).
Data as JSON: /api/errors/4fd45fefd5403447.
Report an issue: GitHub.