{"record":{"id":"066db4d8bbedd353","repo":"microsoft/qlib","slug":"please-implement-the-to-series-method","errorCode":null,"errorMessage":"Please implement the `to_series` method","messagePattern":"Please implement the `to_series` method","errorType":"exception","errorClass":"NotImplementedError","httpStatus":null,"severity":"error","filePath":"qlib/backtest/high_performance_ds.py","lineNumber":433,"sourceCode":"            fill np.nan with value. By default None.\n        \"\"\"\n\n        raise NotImplementedError(f\"Please implement the 'sum_all_indicators' method\")\n\n    def to_series(self) -> Dict[Text, pd.Series]:\n        \"\"\"return the metrics as pandas series\n\n        for example: { \"ffr\":\n                SH600068    NaN\n                SH600079    1.0\n                SH600266    NaN\n                           ...\n                SZ300692    NaN\n                SZ300719    NaN,\n                ...\n         }\n        \"\"\"\n        raise NotImplementedError(f\"Please implement the `to_series` method\")\n\n\nclass SingleMetric(BaseSingleMetric):\n    def __init__(self, metric):\n        self.metric = metric\n\n    def __add__(self, other):\n        if isinstance(other, (int, float)):\n            return self.__class__(self.metric + other)\n        elif isinstance(other, self.__class__):\n            return self.__class__(self.metric + other.metric)\n        else:\n            return NotImplemented\n\n    def __sub__(self, other):\n        if isinstance(other, (int, float)):\n            return self.__class__(self.metric - other)\n        elif isinstance(other, self.__class__):","sourceCodeStart":415,"sourceCodeEnd":451,"githubUrl":"https://github.com/microsoft/qlib/blob/79633dd9506ea689e5400dea0197717b5b3d74b7/qlib/backtest/high_performance_ds.py#L415-L451","documentation":"Error \"Please implement the `to_series` method\" thrown in microsoft/qlib.","triggerScenarios":"This error is raised at qlib/backtest/high_performance_ds.py:433 when the guard condition fails: \"Please implement the `to_series` 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 `to_series` method in your subclass before calling it.","Use a concrete class that provides `to_series` instead of the abstract base."],"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"}