{"record":{"id":"e4dc1f8dcadd87d1","repo":"microsoft/qlib","slug":"implement-this-method-if-you-want-to-use-dataset-f-e4dc1f","errorCode":null,"errorMessage":"Implement this method if you want to use dataset feature cache as a cache file for client","messagePattern":"Implement this method if you want to use dataset feature cache as a cache file for client","errorType":"exception","errorClass":"NotImplementedError","httpStatus":null,"severity":"error","filePath":"qlib/data/cache.py","lineNumber":444,"sourceCode":"        self, instruments, fields, start_time=None, end_time=None, freq=\"day\", disk_cache=1, inst_processors=[]\n    ):\n        \"\"\"Get feature dataset using cache.\n\n        Override this method to define how to get feature dataset corresponding to users' own cache mechanism.\n        \"\"\"\n        raise NotImplementedError(\"Implement this method if you want to use dataset feature cache\")\n\n    def _dataset_uri(\n        self, instruments, fields, start_time=None, end_time=None, freq=\"day\", disk_cache=1, inst_processors=[]\n    ):\n        \"\"\"Get a uri of feature dataset using cache.\n        specially:\n            disk_cache=1 means using data set cache and return the uri of cache file.\n            disk_cache=0 means client knows the path of expression cache,\n                         server checks if the cache exists(if not, generate it), and client loads data by itself.\n        Override this method to define how to get feature dataset uri corresponding to users' own cache mechanism.\n        \"\"\"\n        raise NotImplementedError(\n            \"Implement this method if you want to use dataset feature cache as a cache file for client\"\n        )\n\n    def update(self, cache_uri: Union[str, Path], freq: str = \"day\"):\n        \"\"\"Update dataset cache to latest calendar.\n\n        Override this method to define how to update dataset cache corresponding to users' own cache mechanism.\n\n        Parameters\n        ----------\n        cache_uri : str or Path\n            the complete uri of dataset 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)","sourceCodeStart":426,"sourceCodeEnd":462,"githubUrl":"https://github.com/microsoft/qlib/blob/79633dd9506ea689e5400dea0197717b5b3d74b7/qlib/data/cache.py#L426-L462","documentation":"Error \"Implement this method if you want to use dataset feature cache as a cache file for client\" thrown in microsoft/qlib.","triggerScenarios":"This error is raised at qlib/data/cache.py:444 when the guard condition fails: \"Implement this method if you want to use dataset feature cache as a cache file for client\". 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 client dataset-cache method in your cache subclass.","Use the built-in DiskDatasetCache which implements client cache support."],"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"}