microsoft/qlib · error · NotImplementedError

This type of input is not supported

Error message

This type of input is not supported

What it means

FeaAnalyser.plot_single (qlib/contrib/report/data/base.py) is an abstract hook: the base class intentionally raises NotImplementedError so every subclass must supply its own per-column plotting logic. Hitting it means an instance of the base class (or a subclass that never overrode plot_single) went through plot_all(), which calls plot_single(col, ax) for every non-skipped column.

Source

Thrown at qlib/contrib/report/data/base.py:44

            Aggretation will be used for more summarized metrics overtime.
            Here is an example of data:

            .. code-block::

                                            return
                datetime   instrument
                2007-02-06 equity_tpx     0.010087
                           equity_spx     0.000786
        """
        self._dataset = dataset
        with TimeInspector.logt("calc_stat_values"):
            self.calc_stat_values()

    def calc_stat_values(self):
        pass

    def plot_single(self, col, ax):
        raise NotImplementedError(f"This type of input is not supported")

    def skip(self, col):
        return False

    def plot_all(self, *args, **kwargs):
        ax_gen = iter(sub_fig_generator(*args, **kwargs))
        for col in self._dataset:
            if not self.skip(col):
                ax = next(ax_gen)
                self.plot_single(col, ax)

View on GitHub (pinned to 79633dd950)

Solutions

  1. Implement plot_single(self, col, ax) in your FeaAnalyser subclass to draw one column onto the matplotlib axes
  2. If you did implement it, check for typos in the method name or wrong signature so the override actually binds
  3. Do not instantiate the base FeaAnalyser directly; always use a concrete subclass

Example fix

class MyAna(FeaAnalyser):
    def plot_single(self, col, ax):
        self._dataset[col].plot.hist(ax=ax, bins=50)
        ax.set_title(col)
Defensive patterns

Strategy: type-guard

Type guard

import inspect

def implements_plot_single(cls) -> bool:
    return 'plot_single' in cls.__dict__ or any('plot_single' in vars(c) for c in cls.__mro__[1:-1] if c is not FeaAnalyser)

Try / catch

try:
    ana.plot_all()
except NotImplementedError as e:
    logger.error('analyser %s lacks plot_single: %s', type(ana).__name__, e)

Prevention

When it happens

Trigger: Calling plot_all() on a FeaAnalyser subclass that defines calc_stat_values but forgets to override plot_single; or instantiating FeaAnalyser itself and calling plot_all().

Common situations: Writing a custom feature analyser for qlib's report module and missing the plot_single implementation; refactoring a subclass and accidentally renaming/deleting the method so the base implementation is reached.

Related errors


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