microsoft/qlib · error · NotImplementedError
Please implement the `list` method
Error message
Please implement the `list` method
What it means
list() enumerates all stored object names in the abstract ObjManager interface; the base stub raises NotImplementedError. Only concrete managers can enumerate their backend (FileManager lists files in its directory). The failure indicates the abstract base or an incomplete subclass was asked to enumerate.
Source
Thrown at qlib/utils/objm.py:77
name of the objecT
Returns
-------
bool:
If the object exists
"""
raise NotImplementedError(f"Please implement the `exists` method")
def list(self) -> list:
"""
list the objects
Returns
-------
list:
the list of returned objects
"""
raise NotImplementedError(f"Please implement the `list` method")
def remove(self, fname=None):
"""remove.
Parameters
----------
fname :
if file name is provided. specific file is removed
otherwise, The all the objects will be removed.
"""
raise NotImplementedError(f"Please implement the `remove` method")
class FileManager(ObjManager):
"""
Use file system to manage objects
"""
View on GitHub (pinned to 79633dd950)
Solutions
- Use FileManager (list() returns the names of files it manages).
- Implement list(self) -> list in your subclass returning all names present in the backend.
- Interim workaround: track names yourself at save time and iterate that record instead of calling list().
Example fix
// before names = ObjManager().list() # NotImplementedError // after names = FileManager(path='./objs').list()
Defensive patterns
Strategy: try-catch
Validate before calling
from qlib.utils.objm import ObjManager
if type(mgr).list is ObjManager.list:
names = [] # or raise early with a clear message
else:
names = mgr.list() Type guard
def supports_list(mgr) -> bool:
return type(mgr).list is not ObjManager.list Try / catch
try:
names = mgr.list()
except NotImplementedError:
names = [p.name for p in Path(backup_dir).iterdir()] # fallback enumeration Prevention
- Implement list() in custom managers even if trivial (return sorted stored keys).
- Keep your own registry of saved names when backend enumeration is expensive.
When it happens
Trigger: ObjManager().list(), or mgr.list() where mgr is a custom ObjManager subclass without a list() override — commonly in cleanup or inventory scripts.
Common situations: Maintenance/cleanup scripts that iterate all cached artifacts; dashboards listing available models; custom DB-backed managers implemented with only save/load during initial development.
Related errors
- Please implement `save_obj`
- Please implement the `save_objs` method
- Please implement the `load_obj` method
- Please implement the `exists` method
- Please implement the `remove` method
AI-assisted analysis of microsoft/qlib@79633dd950 (2026-08-15).
Data as JSON: /api/errors/8c9913227eccdac1.
Report an issue: GitHub.