microsoft/qlib · error · NotImplementedError
Implement this method if you want to use dataset feature cac
Error message
Implement this method if you want to use dataset feature cache
What it means
Error "Implement this method if you want to use dataset feature cache" thrown in microsoft/qlib.
Source
Thrown at qlib/data/cache.py:432
return self.provider.dataset(
instruments, fields, start_time, end_time, freq, inst_processors=inst_processors
)
def _uri(self, instruments, fields, start_time, end_time, freq, **kwargs):
"""Get dataset cache file uri.
Override this method to define how to get dataset cache file uri corresponding to users' own cache mechanism.
"""
raise NotImplementedError("Implement this function to match your own cache mechanism")
def _dataset(
self, instruments, fields, start_time=None, end_time=None, freq="day", disk_cache=1, inst_processors=[]
):
"""Get feature dataset using cache.
Override this method to define how to get feature dataset corresponding to users' own cache mechanism.
"""
raise NotImplementedError("Implement this method if you want to use dataset feature cache")
def _dataset_uri(
self, instruments, fields, start_time=None, end_time=None, freq="day", disk_cache=1, inst_processors=[]
):
"""Get a uri of feature dataset using cache.
specially:
disk_cache=1 means using data set cache and return the uri of cache file.
disk_cache=0 means client knows the path of expression cache,
server checks if the cache exists(if not, generate it), and client loads data by itself.
Override this method to define how to get feature dataset uri corresponding to users' own cache mechanism.
"""
raise NotImplementedError(
"Implement this method if you want to use dataset feature cache as a cache file for client"
)
def update(self, cache_uri: Union[str, Path], freq: str = "day"):
"""Update dataset cache to latest calendar.
View on GitHub (pinned to 79633dd950)
Solutions
- Implement the dataset feature cache method in your cache subclass.
- Use the built-in DiskDatasetCache which implements this method.
When it happens
Trigger: This error is raised at qlib/data/cache.py:432 when the guard condition fails: "Implement this method if you want to use dataset feature cache". It triggers when the code path receives input or a state that violates the precondition checked at this point — e.g. an unimplemented abstract method being called, an unsupported argument type/value, or an invalid configuration. To avoid it, satisfy the documented precondition before this call: implement the required method in your subclass, or pass a supported value of the expected type as described by the message.
Common situations: See trigger scenarios.
AI-assisted analysis of microsoft/qlib@79633dd950 (2026-08-15).
Data as JSON: /api/errors/c4265226662718e7.
Report an issue: GitHub.