{"record":{"id":"f3af2308c3b1a0b5","repo":"microsoft/qlib","slug":"freq-format-is-not-supported-the-freq-should-be-l","errorCode":null,"errorMessage":"freq format is not supported, the freq should be like (n)month/mon, (n)week/w, (n)day/d, (n)minute/min","messagePattern":"freq format is not supported, the freq should be like \\(n\\)month/mon, \\(n\\)week/w, \\(n\\)day/d, \\(n\\)minute/min","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"qlib/utils/time.py","lineNumber":169,"sourceCode":"        -------\n        freq: Tuple[int, str]\n            Unified freq, including freq count and unified freq unit. The freq unit should be '[month|week|day|minute]'.\n                Example:\n\n                .. code-block::\n\n                    print(Freq.parse(\"day\"))\n                    (1, \"day\" )\n                    print(Freq.parse(\"2mon\"))\n                    (2, \"month\")\n                    print(Freq.parse(\"10w\"))\n                    (10, \"week\")\n\n        \"\"\"\n        freq = freq.lower()\n        match_obj = re.match(\"^([0-9]*)(month|mon|week|w|day|d|minute|min)$\", freq)\n        if match_obj is None:\n            raise ValueError(\n                \"freq format is not supported, the freq should be like (n)month/mon, (n)week/w, (n)day/d, (n)minute/min\"\n            )\n        _count = int(match_obj.group(1)) if match_obj.group(1) else 1\n        _freq = match_obj.group(2)\n        _freq_format_dict = {\n            \"month\": Freq.NORM_FREQ_MONTH,\n            \"mon\": Freq.NORM_FREQ_MONTH,\n            \"week\": Freq.NORM_FREQ_WEEK,\n            \"w\": Freq.NORM_FREQ_WEEK,\n            \"day\": Freq.NORM_FREQ_DAY,\n            \"d\": Freq.NORM_FREQ_DAY,\n            \"minute\": Freq.NORM_FREQ_MINUTE,\n            \"min\": Freq.NORM_FREQ_MINUTE,\n        }\n        return _count, _freq_format_dict[_freq]\n\n    @staticmethod\n    def get_timedelta(n: int, freq: str) -> pd.Timedelta:","sourceCodeStart":151,"sourceCodeEnd":187,"githubUrl":"https://github.com/microsoft/qlib/blob/79633dd9506ea689e5400dea0197717b5b3d74b7/qlib/utils/time.py#L151-L187","documentation":"Error \"freq format is not supported, the freq should be like (n)month/mon, (n)week/w, (n)day/d, (n)minute/min\" thrown in microsoft/qlib.","triggerScenarios":"This error is raised at qlib/utils/time.py:169 when the guard condition fails: \"freq format is not supported\". It triggers when the code path receives input or a state that violates the precondition checked at this point — e.g. an unimplemented abstract method being called, an unsupported argument type/value, or an invalid configuration. To avoid it, satisfy the documented precondition before this call: implement the required method in your subclass, or pass a supported value of the expected type as described by the message.","commonSituations":"See trigger scenarios.","solutions":["Use a freq string like (n)month/mon, (n)week/w, (n)day/d, or (n)minute/min, e.g. '1day', '5min'.","Fix the freq format in your config or call to match the supported pattern."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"79633dd9506ea689e5400dea0197717b5b3d74b7","analyzedAt":"2026-08-15T07:01:27.511Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}