{"record":{"id":"6b9eeedd47a0b16e","repo":"microsoft/qlib","slug":"this-type-of-input-is-not-supported-6b9eee","errorCode":null,"errorMessage":"This type of input is not supported","messagePattern":"This type of input is not supported","errorType":"exception","errorClass":"NotImplementedError","httpStatus":null,"severity":"error","filePath":"qlib/contrib/rolling/base.py","lineNumber":161,"sourceCode":"        return task\n\n    def basic_task(self, enable_handler_cache: Optional[bool] = True):\n        \"\"\"\n        The basic task may not be the exactly same as the config from `conf_path` from __init__ due to\n        - some parameters could be overriding by some parameters from __init__\n        - user could implementing sublcass to change it for higher performance\n        \"\"\"\n        task: dict = self._raw_conf()[\"task\"]\n        task = deepcopy(task)\n\n        # modify dataset horizon\n        # NOTE:\n        # It assumpts that the label can be modifiled in the handler's kwargs\n        # But is not always a valid. It is only valid in the predefined dataset `Alpha158` & `Alpha360`\n        if self.horizon is None:\n            # TODO:\n            # - get horizon automatically from the expression!!!!\n            raise NotImplementedError(f\"This type of input is not supported\")\n        else:\n            if enable_handler_cache and self.h_path is not None:\n                self.logger.info(\"Fail to override the horizon due to data handler cache\")\n            else:\n                self.logger.info(\"The prediction horizon is overrided\")\n                if isinstance(task[\"dataset\"][\"kwargs\"][\"handler\"], dict):\n                    task[\"dataset\"][\"kwargs\"][\"handler\"][\"kwargs\"][\"label\"] = [\n                        \"Ref($close, -{}) / Ref($close, -1) - 1\".format(self.horizon + 1)\n                    ]\n                else:\n                    self.logger.warning(\"Try to automatically configure the lablel but failed.\")\n\n        if self.h_path is not None or enable_handler_cache:\n            # if we already have provided data source or we want to create one\n            task = self._replace_handler_with_cache(task)\n        task = self._update_start_end_time(task)\n\n        if self.task_ext_conf is not None:","sourceCodeStart":143,"sourceCodeEnd":179,"githubUrl":"https://github.com/microsoft/qlib/blob/79633dd9506ea689e5400dea0197717b5b3d74b7/qlib/contrib/rolling/base.py#L143-L179","documentation":"Rolling base class (qlib/contrib/rolling/base.py) rewrites a task's label horizon on every basic_task() call. It can only do that when the user supplies an explicit horizon; if self.horizon is None there is no way to derive it automatically (an acknowledged TODO), so NotImplementedError is raised.","triggerScenarios":"Constructing a Rolling task manager (e.g. DDGDA, Rolling) without the horizon argument and then calling basic_task() or a workflow step that calls it (run / _get_task_temp_related).","commonSituations":"Copying a benchmark workflow config for rolling retraining but omitting the horizon field; assuming horizon is inferred from the Alpha158/Alpha360 label expression automatically.","solutions":["Pass the horizon argument when constructing the rolling task, e.g. horizon=1","Set it in the rolling workflow config under the corresponding key so self.horizon is populated","If you subclass Rolling, you may override basic_task to supply horizon from your own label expression"],"exampleFix":"# before\nroll = DDGDA(..., steps=40, horizon=None)\n\n# after\nroll = DDGDA(..., steps=40, horizon=1)","handlingStrategy":"validation","validationCode":"assert horizon is not None and int(horizon) > 0, 'Rolling tasks require an explicit horizon (e.g. horizon=1)'\nroll = DDGDA(..., horizon=horizon)","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Always set horizon in rolling-retraining configs; it cannot be auto-derived from the label expression yet","Validate rolling workflow YAMLs against the shipped examples before running"],"tags":["qlib","rolling","workflow","configuration"],"backgroundTag":null,"analyzedSha":"79633dd9506ea689e5400dea0197717b5b3d74b7","analyzedAt":"2026-08-15T07:01:27.511Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}