{"record":{"id":"04854aff52c7282c","repo":"microsoft/qlib","slug":"implement-this-method-if-you-want-to-make-expressi","errorCode":null,"errorMessage":"Implement this method if you want to make expression cache up to date","messagePattern":"Implement this method if you want to make expression cache up to date","errorType":"exception","errorClass":"NotImplementedError","httpStatus":null,"severity":"error","filePath":"qlib/data/cache.py","lineNumber":378,"sourceCode":"        raise NotImplementedError(\"Implement this method if you want to use expression cache\")\n\n    def update(self, cache_uri: Union[str, Path], freq: str = \"day\"):\n        \"\"\"Update expression cache to latest calendar.\n\n        Override this method to define how to update expression cache corresponding to users' own cache mechanism.\n\n        Parameters\n        ----------\n        cache_uri : str or Path\n            the complete uri of expression cache file (include dir path).\n        freq : str\n\n        Returns\n        -------\n        int\n            0(successful update)/ 1(no need to update)/ 2(update failure).\n        \"\"\"\n        raise NotImplementedError(\"Implement this method if you want to make expression cache up to date\")\n\n\nclass DatasetCache(BaseProviderCache):\n    \"\"\"Dataset cache mechanism base class.\n\n    This class is used to wrap dataset provider with self-defined dataset cache mechanism.\n\n    .. note:: Override the `_uri` and `_dataset` method to create your own dataset cache mechanism.\n    \"\"\"\n\n    HDF_KEY = \"df\"\n\n    def dataset(\n        self, instruments, fields, start_time=None, end_time=None, freq=\"day\", disk_cache=1, inst_processors=[]\n    ):\n        \"\"\"Get feature dataset.\n\n        .. note:: Same interface as `dataset` method in dataset provider","sourceCodeStart":360,"sourceCodeEnd":396,"githubUrl":"https://github.com/microsoft/qlib/blob/79633dd9506ea689e5400dea0197717b5b3d74b7/qlib/data/cache.py#L360-L396","documentation":"Error \"Implement this method if you want to make expression cache up to date\" thrown in microsoft/qlib.","triggerScenarios":"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.","commonSituations":"See trigger scenarios.","solutions":["Implement the cache-updating method in your expression cache subclass.","Use the built-in DiskExpressionCache which implements cache updating."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"79633dd9506ea689e5400dea0197717b5b3d74b7","analyzedAt":"2026-08-15T07:01:27.511Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}