{"record":{"id":"88833a958f3894b4","repo":"microsoft/qlib","slug":"this-type-of-input-is-not-supported-88833a","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/report.py","lineNumber":413,"sourceCode":"        agg = pa_config.get(\"agg\", \"twap\").lower()\n        price = pa_config.get(\"price\", \"deal_price\").lower()\n\n        if decision.trade_range is not None:\n            trade_start_time, trade_end_time = decision.trade_range.clip_time_range(\n                start_time=trade_start_time,\n                end_time=trade_end_time,\n            )\n\n        if price == \"deal_price\":\n            price_s = trade_exchange.get_deal_price(\n                inst,\n                trade_start_time,\n                trade_end_time,\n                direction=direction,\n                method=None,\n            )\n        else:\n            raise NotImplementedError(f\"This type of input is not supported\")\n\n        # if there is no stock data during the time period\n        if price_s is None:\n            return None, None\n\n        if isinstance(price_s, (int, float, np.number)):\n            price_s = idd.SingleData(price_s, [trade_start_time])\n        elif isinstance(price_s, idd.SingleData):\n            pass\n        else:\n            raise NotImplementedError(f\"This type of input is not supported\")\n\n        # NOTE: there are some zeros in the trading price. These cases are known meaningless\n        # for aligning the previous logic, remove it.\n        # remove zero and negative values.\n        assert isinstance(price_s, idd.SingleData)\n        price_s = price_s.loc[(price_s > 1e-08).data.astype(bool)]\n        # NOTE ~(price_s < 1e-08) is different from price_s >= 1e-8","sourceCodeStart":395,"sourceCodeEnd":431,"githubUrl":"https://github.com/microsoft/qlib/blob/79633dd9506ea689e5400dea0197717b5b3d74b7/qlib/backtest/report.py#L395-L431","documentation":"TradeDecision-related analysis in report.py (_get_base_vol_pri, the source of all base prices for PA/aggrotor-style analysis) selects the price source from pa_config['price']: only 'deal_price' is implemented, so any other value raises NotImplementedError('This type of input is not supported'). (The same message appears again a few lines down if get_deal_price returns an unexpected type.)","triggerScenarios":"Passing pa_config with price='close', 'vwap', 'twap_price' etc. into the trade-analysis flow that calls _get_base_vol_pri; the key is lowercased before comparison, so 'Deal_Price' is fine but any non-deal_price name fails.","commonSituations":"Trying to analyze orders against raw close/vwap prices (unsupported in this build); copying pa_config from older/newer qlib examples where more price sources existed; misspelling 'deal_price'.","solutions":["Set pa_config['price'] = 'deal_price' (case-insensitive) or omit it — 'deal_price' is the default","If you need another price, compute it yourself against exchange.get_deal_price-like data instead of this API","Update qlib if a newer release adds the price source you need"],"exampleFix":"# before\npa_config = {\"agg\": \"twap\", \"price\": \"close\"}\n\n# after\npa_config = {\"agg\": \"twap\", \"price\": \"deal_price\"}","handlingStrategy":"validation","validationCode":"price = pa_config.get(\"price\", \"deal_price\").lower()\nassert price == \"deal_price\", f\"unsupported price source {price!r}; only 'deal_price' is implemented\"","typeGuard":"def is_supported_price(pa_config: dict) -> bool:\n    return pa_config.get(\"price\", \"deal_price\").lower() == \"deal_price\"","tryCatchPattern":"try:\n    _get_base_vol_pri(...)\nexcept NotImplementedError:\n    pa_config = {**pa_config, \"price\": \"deal_price\"}  # retry with the supported source","preventionTips":["Omit 'price' in pa_config to use the default","Check release notes before configuring non-deal_price sources","Normalize keys to lowercase before passing configs through"],"tags":["qlib","backtest","trade-analysis","not-implemented","invalid-argument"],"backgroundTag":null,"analyzedSha":"79633dd9506ea689e5400dea0197717b5b3d74b7","analyzedAt":"2026-08-15T07:01:27.511Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}