{"record":{"id":"c0e24f3704f4ee7b","repo":"microsoft/qlib","slug":"subclass-of-calendarstorage-must-implement-clear","errorCode":null,"errorMessage":"Subclass of CalendarStorage must implement `clear` method","messagePattern":"Subclass of CalendarStorage must implement `clear` method","errorType":"exception","errorClass":"NotImplementedError","httpStatus":null,"severity":"error","filePath":"qlib/data/storage/storage.py","lineNumber":106,"sourceCode":"\n    def __init__(self, freq: str, future: bool, **kwargs):\n        self.freq = freq\n        self.future = future\n        self.kwargs = kwargs\n\n    @property\n    def data(self) -> Iterable[CalVT]:\n        \"\"\"get all data\n\n        Raises\n        ------\n        ValueError\n            If the data(storage) does not exist, raise ValueError\n        \"\"\"\n        raise NotImplementedError(\"Subclass of CalendarStorage must implement `data` method\")\n\n    def clear(self) -> None:\n        raise NotImplementedError(\"Subclass of CalendarStorage must implement `clear` method\")\n\n    def extend(self, iterable: Iterable[CalVT]) -> None:\n        raise NotImplementedError(\"Subclass of CalendarStorage must implement `extend` method\")\n\n    def index(self, value: CalVT) -> int:\n        \"\"\"\n        Raises\n        ------\n        ValueError\n            If the data(storage) does not exist, raise ValueError\n        \"\"\"\n        raise NotImplementedError(\"Subclass of CalendarStorage must implement `index` method\")\n\n    def insert(self, index: int, value: CalVT) -> None:\n        raise NotImplementedError(\"Subclass of CalendarStorage must implement `insert` method\")\n\n    def remove(self, value: CalVT) -> None:\n        raise NotImplementedError(\"Subclass of CalendarStorage must implement `remove` method\")","sourceCodeStart":88,"sourceCodeEnd":124,"githubUrl":"https://github.com/microsoft/qlib/blob/79633dd9506ea689e5400dea0197717b5b3d74b7/qlib/data/storage/storage.py#L88-L124","documentation":"Error \"Subclass of CalendarStorage must implement `clear` method\" thrown in microsoft/qlib.","triggerScenarios":"This error is raised at qlib/data/storage/storage.py:106 when the guard condition fails: \"Subclass of CalendarStorage must implement `clear` method\". 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 `clear` method in your CalendarStorage subclass.","Use the built-in FileCalendarStorage which implements `clear`."],"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-15T17:31:12.345Z"}