{"record":{"id":"25939f332a9e0182","repo":"microsoft/qlib","slug":"cannot-support-interval-25939f","errorCode":null,"errorMessage":"cannot support {interval}","messagePattern":"cannot support (.+?)","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"scripts/data_collector/fund/collector.py","lineNumber":146,"sourceCode":"            logger.warning(f\"{error_msg}:{e}\")\n\n    def get_data(\n        self, symbol: str, interval: str, start_datetime: pd.Timestamp, end_datetime: pd.Timestamp\n    ) -> [pd.DataFrame]:\n        def _get_simple(start_, end_):\n            self.sleep()\n            _remote_interval = interval\n            return self.get_data_from_remote(\n                symbol,\n                interval=_remote_interval,\n                start=start_,\n                end=end_,\n            )\n\n        if interval == self.INTERVAL_1d:\n            _result = _get_simple(start_datetime, end_datetime)\n        else:\n            raise ValueError(f\"cannot support {interval}\")\n        return _result\n\n\nclass FundollectorCN(FundCollector, ABC):\n    def get_instrument_list(self):\n        logger.info(\"get cn fund symbols......\")\n        symbols = get_en_fund_symbols()\n        logger.info(f\"get {len(symbols)} symbols.\")\n        return symbols\n\n    def normalize_symbol(self, symbol):\n        return symbol\n\n    @property\n    def _timezone(self):\n        return \"Asia/Shanghai\"\n\n","sourceCodeStart":128,"sourceCodeEnd":164,"githubUrl":"https://github.com/microsoft/qlib/blob/79633dd9506ea689e5400dea0197717b5b3d74b7/scripts/data_collector/fund/collector.py#L128-L164","documentation":"Raised by FundCollector.get_data (scripts/data_collector/fund/collector.py:146) when the requested bar interval is anything other than the class constant INTERVAL_1d. The fund collector pipeline only knows how to fetch daily bars; any other interval string (e.g. '1min', '60m', 'weekly') reaches the final else-branch and raises ValueError. This is a capability gate, not a runtime data failure.","triggerScenarios":"Calling collector_data()/get_data(symbol, interval=...) on a FundCollector subclass with interval not equal to self.INTERVAL_1d (typically '1d'). Note the branch above shows a nested path that retries via get_data_from_remote with a _remote_interval, but only the INTERVAL_1d case reaches _get_simple; everything else falls through to the raise.","commonSituations":"Copying a stock collector invocation (e.g. --interval 1min used with the yahoo collector) into the fund collector; passing a Binance-style interval string like '1d' vs '1day' mismatch; running fund collection with a config file written for minute data.","solutions":["Pass interval exactly equal to the collector's INTERVAL_1d constant (normally '1d') when invoking the fund collector.","Check the collector's supported intervals (grep for INTERVAL_ constants in scripts/data_collector/fund/collector.py) before launching collection jobs.","If intraday fund data is genuinely required, use a different data source/collector; do not try to force this one."],"exampleFix":"# before\ncollector.get_data(symbol='000001', interval='1min', start_datetime=..., end_datetime=...)\n\n# after\nfrom scripts.data_collector.fund.collector import FundollectorCN\ncollector.get_data(symbol='000001', interval=FundollectorCN.INTERVAL_1d, start_datetime=..., end_datetime=...)","handlingStrategy":"validation","validationCode":"from scripts.data_collector.fund.collector import FundollectorCN\nallowed = {FundollectorCN.INTERVAL_1d}\nassert interval in allowed, f'fund collector supports only {allowed}, got {interval}'","typeGuard":"def is_supported_fund_interval(interval: str, cls=FundollectorCN) -> bool:\n    return interval == cls.INTERVAL_1d","tryCatchPattern":"try:\n    df = collector.get_data(symbol, interval=interval, ...)\nexcept ValueError as e:\n    if 'cannot support' in str(e):\n        raise SystemExit(f'unsupported interval for fund collection: {interval}')\n    raise","preventionTips":["Always pass interval from the collector class constants rather than literal strings.","Check a collector's INTERVAL_* constants before scheduling it with a shared config."],"tags":["fund-collector","interval","validation","python"],"backgroundTag":null,"analyzedSha":"79633dd9506ea689e5400dea0197717b5b3d74b7","analyzedAt":"2026-08-15T07:01:27.511Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}