microsoft/qlib · error · NotImplementedError

Please implement the 'sum_all_indicators' method

Error message

Please implement the 'sum_all_indicators' method

What it means

Error "Please implement the 'sum_all_indicators' method" thrown in microsoft/qlib.

Source

Thrown at qlib/backtest/high_performance_ds.py:418

        fill_value: float = 0,
    ) -> None:
        """sum indicators with the same metrics.
        and assign to the order_indicator(BaseOrderIndicator).
        NOTE: indicators could be a empty list when orders in lower level all fail.

        Parameters
        ----------
        order_indicator : BaseOrderIndicator
            the order indicator to assign.
        indicators : List[BaseOrderIndicator]
            the list of all inner indicators.
        metrics : Union[str, List[str]]
            all metrics needs to be sumed.
        fill_value : float, optional
            fill np.nan with value. By default None.
        """

        raise NotImplementedError(f"Please implement the 'sum_all_indicators' method")

    def to_series(self) -> Dict[Text, pd.Series]:
        """return the metrics as pandas series

        for example: { "ffr":
                SH600068    NaN
                SH600079    1.0
                SH600266    NaN
                           ...
                SZ300692    NaN
                SZ300719    NaN,
                ...
         }
        """
        raise NotImplementedError(f"Please implement the `to_series` method")


class SingleMetric(BaseSingleMetric):

View on GitHub (pinned to 79633dd950)

Solutions

  1. Implement the `sum_all_indicators` method in your subclass before calling it.
  2. Use a concrete class that provides `sum_all_indicators` instead of the abstract base.

When it happens

Trigger: This error is raised at qlib/backtest/high_performance_ds.py:418 when the guard condition fails: "Please implement the 'sum_all_indicators' 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.

Common situations: See trigger scenarios.


AI-assisted analysis of microsoft/qlib@79633dd950 (2026-08-15). Data as JSON: /api/errors/0a879c82cbcf70cd. Report an issue: GitHub.