{"record":{"id":"0080ecebaa52acf6","repo":"microsoft/qlib","slug":"self-storage-name-self-provider-uri-does-not","errorCode":null,"errorMessage":"{self.storage_name}: {self.provider_uri} does not contain data for {self.freq}","messagePattern":"(.+?): (.+?) does not contain data for (.+?)","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"qlib/data/storage/file_storage.py","lineNumber":62,"sourceCode":"    def support_freq(self) -> List[str]:\n        _v = \"_support_freq\"\n        if hasattr(self, _v):\n            return getattr(self, _v)\n        if len(self.provider_uri) == 1 and C.DEFAULT_FREQ in self.provider_uri:\n            freq_l = filter(\n                lambda _freq: not _freq.endswith(\"_future\"),\n                map(lambda x: x.stem, self.dpm.get_data_uri(C.DEFAULT_FREQ).joinpath(\"calendars\").glob(\"*.txt\")),\n            )\n        else:\n            freq_l = self.provider_uri.keys()\n        freq_l = [Freq(freq) for freq in freq_l]\n        setattr(self, _v, freq_l)\n        return freq_l\n\n    @property\n    def uri(self) -> Path:\n        if self.freq not in self.support_freq:\n            raise ValueError(f\"{self.storage_name}: {self.provider_uri} does not contain data for {self.freq}\")\n        return self.dpm.get_data_uri(self.freq).joinpath(f\"{self.storage_name}s\", self.file_name)\n\n    def check(self):\n        \"\"\"check self.uri\n\n        Raises\n        -------\n        ValueError\n        \"\"\"\n        if not self.uri.exists():\n            raise ValueError(f\"{self.storage_name} not exists: {self.uri}\")\n\n\nclass FileCalendarStorage(FileStorageMixin, CalendarStorage):\n    def __init__(self, freq: str, future: bool, provider_uri: dict = None, **kwargs):\n        super(FileCalendarStorage, self).__init__(freq, future, **kwargs)\n        self.future = future\n        self._provider_uri = None if provider_uri is None else C.DataPathManager.format_provider_uri(provider_uri)","sourceCodeStart":44,"sourceCodeEnd":80,"githubUrl":"https://github.com/microsoft/qlib/blob/79633dd9506ea689e5400dea0197717b5b3d74b7/qlib/data/storage/file_storage.py#L44-L80","documentation":"Raised by FileStorageMixin.uri (qlib/data/storage/file_storage.py) when the requested frequency is not among the frequencies discovered on disk (support_freq). For a single-path provider, support_freq is derived from calendar .txt files under calendars/; for a multi-path provider, from the provider_uri dict keys. Accessing data at a freq that was never dumped therefore fails with this ValueError.","triggerScenarios":"Requesting freq=\"1min\" when only a day-level calendar exists (calendars/day.txt); passing a freq key not present in the provider_uri mapping; misspelled freq strings (\"day \" vs \"day\", \"daily\" vs \"day\"); using remote/mounted data where some freq folders are absent.","commonSituations":"Switching a workflow from daily to minute data without dumping/downloading minute bins and calendars; provider_uri configured for multiple freqs but the data directory for one freq missing; trailing-whitespace or case mistakes in freq strings in configs.","solutions":["Check what exists on disk: ls <provider_uri>/calendars/ — the .txt stems (minus _future) are the supported freqs; request one of those.","Dump or download the data for the missing freq (qlib's dump scripts or get_data methods for the dataset you use).","Fix the freq string: qlib canonical names are like 'day', '1min'; remove whitespace and verify against the calendar filenames.","For multi-freq provider_uri dicts, ensure the key matches the freq you request exactly."],"exampleFix":"# before\nprovider_uri = \"~/.qlib/qlib_data/cn_data\"   # only has calendars/day.txt\nD.features([\"SH600000\"], [\"$close\"], freq=\"1min\")  # ValueError\n\n# after\nD.features([\"SH600000\"], [\"$close\"], freq=\"day\")  # or dump 1min data first","handlingStrategy":"validation","validationCode":"from pathlib import Path\nsupported = {p.stem.split(\".\")[0].removesuffix(\"_future\") for p in (Path(provider_uri) / \"calendars\").glob(\"*.txt\")}\nif freq not in supported:\n    raise ValueError(f\"freq {freq} not on disk; available: {sorted(supported)}\")","typeGuard":"def freq_available(provider_uri: str, freq: str) -> bool:\n    return (Path(provider_uri) / \"calendars\" / f\"{freq}.txt\").exists()","tryCatchPattern":"try:\n    D.features(insts, fields, start, end, freq=freq)\nexcept ValueError as e:\n    if \"does not contain data\" in str(e):\n        raise SystemExit(f\"missing data for {freq}; dump it or use an available freq\") from e\n    raise","preventionTips":["Run a startup check that provider_uri/calendars covers every freq in your config.","Standardize freq strings from a constants module to avoid spelling drift."],"tags":["qlib","storage","frequency","data-availability"],"backgroundTag":null,"analyzedSha":"79633dd9506ea689e5400dea0197717b5b3d74b7","analyzedAt":"2026-08-15T07:01:27.511Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}