{"record":{"id":"7d1f3af5b6ee935b","repo":"microsoft/qlib","slug":"this-type-of-input-is-not-supported","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/backtest/decision.py","lineNumber":129,"sourceCode":"        - `+1` indicates buying\n        - `-1` value indicates selling\n        \"\"\"\n        return self.direction * 2 - 1\n\n    @staticmethod\n    def parse_dir(direction: Union[str, int, np.integer, OrderDir, np.ndarray]) -> Union[OrderDir, np.ndarray]:\n        if isinstance(direction, OrderDir):\n            return direction\n        elif isinstance(direction, (int, float, np.integer, np.floating)):\n            return Order.BUY if direction > 0 else Order.SELL\n        elif isinstance(direction, str):\n            dl = direction.lower().strip()\n            if dl == \"sell\":\n                return OrderDir.SELL\n            elif dl == \"buy\":\n                return OrderDir.BUY\n            else:\n                raise NotImplementedError(f\"This type of input is not supported\")\n        elif isinstance(direction, np.ndarray):\n            direction_array = direction.copy()\n            direction_array[direction_array > 0] = Order.BUY\n            direction_array[direction_array <= 0] = Order.SELL\n            return direction_array\n        else:\n            raise NotImplementedError(f\"This type of input is not supported\")\n\n    @property\n    def key_by_day(self) -> tuple:\n        \"\"\"A hashable & unique key to identify this order, under the granularity in day.\"\"\"\n        return self.stock_id, self.date, self.direction\n\n    @property\n    def key(self) -> tuple:\n        \"\"\"A hashable & unique key to identify this order.\"\"\"\n        return self.stock_id, self.start_time, self.end_time, self.direction\n","sourceCodeStart":111,"sourceCodeEnd":147,"githubUrl":"https://github.com/microsoft/qlib/blob/79633dd9506ea689e5400dea0197717b5b3d74b7/qlib/backtest/decision.py#L111-L147","documentation":"Same inst_processor guard as cache.py:706/762, on the ClientDatasetProvider path (qlib/data/cache.py:1147): when inst_processors is non-empty and disk_cache != 0, the provider cannot use the shared dataset cache (its contents are processor-independent), so it raises ValueError directing you to disk_cache=0 or dataset_cache=None.","triggerScenarios":"Client/server mode: client requests D.features(..., inst_processors=[...]) with the default disk_cache while a dataset cache is configured server-side; the provider falls into the cache-URI branch (self._uri + provider.dataset with return_uri) and hits the guard.","commonSituations":"Deployments adding per-instrument normalization processors to an existing cached pipeline; mixing ClientDatasetProvider with instrument processors without adjusting disk_cache.","solutions":["Use D.features(..., disk_cache=0, inst_processors=[...]) on the client so processors apply post-load","Initialize without a dataset cache: qlib.init(dataset_cache=None)","Relocate instrument processing into the dataset/processor layer (DataHandlerLP processors) so raw cached data remains shareable"],"exampleFix":"# before\nD.features(insts, fields, start, end, inst_processors=[p])  # client + dataset cache -> ValueError\n\n# after\nD.features(insts, fields, start, end, disk_cache=0, inst_processors=[p])","handlingStrategy":"validation","validationCode":"# client-side rule: processors force cache bypass\ndf = D.features(insts, fields, start, end,\n                disk_cache=0 if inst_processors else 1,\n                inst_processors=inst_processors)","typeGuard":"def bypass_dataset_cache(inst_processors) -> bool:\n    return bool(inst_processors)","tryCatchPattern":"try:\n    df = client_D.features(insts, fields, start, end, inst_processors=procs)\nexcept ValueError as e:\n    if \"does not support inst_processor\" in str(e):\n        df = client_D.features(insts, fields, start, end, disk_cache=0, inst_processors=procs)\n    else:\n        raise","preventionTips":["On client deployments, standardize disk_cache=0 for processor-enabled requests","Or initialize both ends with dataset_cache=None when processors are core to the pipeline","Wrap the client provider behind a facade enforcing cache/processor compatibility"],"tags":["qlib","dataset-cache","inst-processors","client-server"],"backgroundTag":null,"analyzedSha":"79633dd9506ea689e5400dea0197717b5b3d74b7","analyzedAt":"2026-08-15T07:01:27.511Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}