microsoft/qlib · error · NotImplementedError
Implement this method if you want to make expression cache u
Error message
Implement this method if you want to make expression cache up to date
What it means
Error "Implement this method if you want to make expression cache up to date" thrown in microsoft/qlib.
Source
Thrown at qlib/data/cache.py:378
raise NotImplementedError("Implement this method if you want to use expression cache")
def update(self, cache_uri: Union[str, Path], freq: str = "day"):
"""Update expression cache to latest calendar.
Override this method to define how to update expression cache corresponding to users' own cache mechanism.
Parameters
----------
cache_uri : str or Path
the complete uri of expression cache file (include dir path).
freq : str
Returns
-------
int
0(successful update)/ 1(no need to update)/ 2(update failure).
"""
raise NotImplementedError("Implement this method if you want to make expression cache up to date")
class DatasetCache(BaseProviderCache):
"""Dataset cache mechanism base class.
This class is used to wrap dataset provider with self-defined dataset cache mechanism.
.. note:: Override the `_uri` and `_dataset` method to create your own dataset cache mechanism.
"""
HDF_KEY = "df"
def dataset(
self, instruments, fields, start_time=None, end_time=None, freq="day", disk_cache=1, inst_processors=[]
):
"""Get feature dataset.
.. note:: Same interface as `dataset` method in dataset providerView on GitHub (pinned to 79633dd950)
Solutions
- Implement the cache-updating method in your expression cache subclass.
- Use the built-in DiskExpressionCache which implements cache updating.
When it happens
Trigger: This error is raised at qlib/data/cache.py:378 when the guard condition fails: "Implement this method if you want to make expression cache up to date". 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/04854aff52c7282c.
Report an issue: GitHub.