{"record":{"id":"0594dd8840b61742","repo":"microsoft/qlib","slug":"interval-error-self-interval-0594dd","errorCode":null,"errorMessage":"interval error: {self.interval}","messagePattern":"interval error: (.+?)","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"scripts/data_collector/fund/collector.py","lineNumber":82,"sourceCode":"            start=start,\n            end=end,\n            interval=interval,\n            max_workers=max_workers,\n            max_collector_count=max_collector_count,\n            delay=delay,\n            check_data_length=check_data_length,\n            limit_nums=limit_nums,\n        )\n\n        self.init_datetime()\n\n    def init_datetime(self):\n        if self.interval == self.INTERVAL_1min:\n            self.start_datetime = max(self.start_datetime, self.DEFAULT_START_DATETIME_1MIN)\n        elif self.interval == self.INTERVAL_1d:\n            pass\n        else:\n            raise ValueError(f\"interval error: {self.interval}\")\n\n        self.start_datetime = self.convert_datetime(self.start_datetime, self._timezone)\n        self.end_datetime = self.convert_datetime(self.end_datetime, self._timezone)\n\n    @staticmethod\n    def convert_datetime(dt: [pd.Timestamp, datetime.date, str], timezone):\n        try:\n            dt = pd.Timestamp(dt, tz=timezone).timestamp()\n            dt = pd.Timestamp(dt, tz=tzlocal(), unit=\"s\")\n        except ValueError as e:\n            pass\n        return dt\n\n    @property\n    @abc.abstractmethod\n    def _timezone(self):\n        raise NotImplementedError(\"rewrite get_timezone\")\n","sourceCodeStart":64,"sourceCodeEnd":100,"githubUrl":"https://github.com/microsoft/qlib/blob/79633dd9506ea689e5400dea0197717b5b3d74b7/scripts/data_collector/fund/collector.py#L64-L100","documentation":"Raised by FundCollector.init_datetime when self.interval is neither INTERVAL_1min nor INTERVAL_1d. Like the crypto collector, the fund collector only supports daily and 1-minute data, clamping 1min starts to a default earliest datetime.","triggerScenarios":"Running the fund collector with --interval other than 1d/1min (e.g. 5min or 'day'), or a config-supplied interval with different naming.","commonSituations":"Reusing interval values from other collectors; typos; whitespace/case differences in CLI args.","solutions":["Use --interval 1d or --interval 1min.","Verify the exact string (no spaces, lowercase) if the value is templated from a script."],"exampleFix":"# before\npython collector.py download_data --interval 5min\n\n# after\npython collector.py download_data --interval 1d","handlingStrategy":"validation","validationCode":"assert interval in (\"1d\", \"1min\"), f\"fund collector supports 1d/1min only, got {interval!r}\"","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Validate CLI interval args (strip/lowercase) before running collectors.","Document supported intervals per collector in pipeline configs."],"tags":["qlib","data-collector","fund","interval","argument-validation"],"backgroundTag":null,"analyzedSha":"79633dd9506ea689e5400dea0197717b5b3d74b7","analyzedAt":"2026-08-15T07:01:27.511Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}