{"record":{"id":"df06dbbb23e550ef","repo":"microsoft/qlib","slug":"freq-freq-is-not-supported","errorCode":null,"errorMessage":"freq {freq} is not supported","messagePattern":"freq (.+?) is not supported","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"qlib/utils/resam.py","lineNumber":98,"sourceCode":"    from ..data.data import D  # pylint: disable=C0415\n\n    try:\n        _result = D.features(instruments, fields, start_time, end_time, freq=freq, disk_cache=disk_cache)\n        _freq = freq\n    except (ValueError, KeyError) as value_key_e:\n        _, norm_freq = Freq.parse(freq)\n        if norm_freq in [Freq.NORM_FREQ_MONTH, Freq.NORM_FREQ_WEEK, Freq.NORM_FREQ_DAY]:\n            try:\n                _result = D.features(instruments, fields, start_time, end_time, freq=\"day\", disk_cache=disk_cache)\n                _freq = \"day\"\n            except (ValueError, KeyError):\n                _result = D.features(instruments, fields, start_time, end_time, freq=\"1min\", disk_cache=disk_cache)\n                _freq = \"1min\"\n        elif norm_freq == Freq.NORM_FREQ_MINUTE:\n            _result = D.features(instruments, fields, start_time, end_time, freq=\"1min\", disk_cache=disk_cache)\n            _freq = \"1min\"\n        else:\n            raise ValueError(f\"freq {freq} is not supported\") from value_key_e\n    return _result, _freq\n\n\ndef resam_ts_data(\n    ts_feature: Union[pd.DataFrame, pd.Series],\n    start_time: Union[str, pd.Timestamp] = None,\n    end_time: Union[str, pd.Timestamp] = None,\n    method: Union[str, Callable] = \"last\",\n    method_kwargs: dict = {},\n):\n    \"\"\"\n    Resample value from time-series data\n\n        - If `feature` has MultiIndex[instrument, datetime], apply the `method` to each instrument data with datetime in [start_time, end_time]\n            Example:\n\n            .. code-block::\n","sourceCodeStart":80,"sourceCodeEnd":116,"githubUrl":"https://github.com/microsoft/qlib/blob/79633dd9506ea689e5400dea0197717b5b3d74b7/qlib/utils/resam.py#L80-L116","documentation":"Error \"freq {freq} is not supported\" thrown in microsoft/qlib.","triggerScenarios":"This error is raised at qlib/utils/resam.py:98 when the guard condition fails: \"freq {freq} 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":["Pass a supported frequency string for resampling.","Check the freq value for typos and convert it to a supported unit (min/day/week/month)."],"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-15T22:17:37.221Z"}