{"record":{"id":"e9f91c0e8c92da72","repo":"microsoft/qlib","slug":"this-type-of-uri-is-not-supported-e9f91c","errorCode":null,"errorMessage":"This type of uri is not supported","messagePattern":"This type of uri is not supported","errorType":"exception","errorClass":"NotImplementedError","httpStatus":null,"severity":"error","filePath":"qlib/config.py","lineNumber":405,"sourceCode":"        def get_data_uri(self, freq: Optional[Union[str, Freq]] = None) -> Path:\n            \"\"\"\n            please refer DataPathManager's __init__ and class doc\n            \"\"\"\n            if freq is not None:\n                freq = str(freq)  # converting Freq to string\n            if freq is None or freq not in self.provider_uri:\n                freq = QlibConfig.DEFAULT_FREQ\n            _provider_uri = self.provider_uri[freq]\n            if self.get_uri_type(_provider_uri) == QlibConfig.LOCAL_URI:\n                return Path(_provider_uri)\n            elif self.get_uri_type(_provider_uri) == QlibConfig.NFS_URI:\n                if \"win\" in platform.system().lower():\n                    # windows, mount_path is the drive\n                    _path = str(self.mount_path[freq])\n                    return Path(f\"{_path}:\\\\\") if \":\" not in _path else Path(_path)\n                return Path(self.mount_path[freq])\n            else:\n                raise NotImplementedError(f\"This type of uri is not supported\")\n\n    def set_mode(self, mode):\n        # raise KeyError\n        self.update(MODE_CONF[mode])\n        # TODO: update region based on kwargs\n\n    def set_region(self, region):\n        # raise KeyError\n        self.update(_default_region_config[region])\n\n    @staticmethod\n    def is_depend_redis(cache_name: str):\n        return cache_name in DEPENDENCY_REDIS_CACHE\n\n    @property\n    def dpm(self):\n        return self.DataPathManager(self[\"provider_uri\"], self[\"mount_path\"])\n","sourceCodeStart":387,"sourceCodeEnd":423,"githubUrl":"https://github.com/microsoft/qlib/blob/79633dd9506ea689e5400dea0197717b5b3d74b7/qlib/config.py#L387-L423","documentation":"QlibConfig.DataPathManager.get_uri_type classifies URIs as LOCAL (posix absolute path or windows drive) or NFS (host:/path pattern). When resolving the data path for a frequency, a URI that classifies as neither raises NotImplementedError. In practice a URI that is empty or has an unrecognized shape (no leading '/', no drive letter, no 'host:' prefix — e.g. a bare relative name) falls through to this branch.","triggerScenarios":"provider_uri values like '' (empty string), 'data' (bare relative name with no scheme), or exotic schemes on some platforms reach get_data_uri_path and match neither URI pattern. On Windows, mount-path handling only covers the NFS branch, so malformed mount entries also land here.","commonSituations":"Relative provider_uri strings that were never expanded to absolute paths (normalization usually resolves local URIs, but empty/odd strings can escape it); configs generated by templating that leave a placeholder value; Windows setups where mount_path is missing for an NFS-configured frequency.","solutions":["Use an absolute path for local data: provider_uri='/home/me/qlib_data' or '~/.qlib/qlib_data' (tilde is expanded).","For remote data use the 'host:/path' NFS form and ensure mount_path is provided per frequency on systems requiring mounting.","Validate your provider_uri with QlibConfig.DataPathManager.get_uri_type(uri) during setup and fail early if it returns neither LOCAL nor NFS."],"exampleFix":"# before\nqlib.init(provider_uri='qlib_data')  # bare relative name -> NotImplementedError\n# after\nqlib.init(provider_uri=str(Path('qlib_data').resolve()))  # absolute local path","handlingStrategy":"validation","validationCode":"from qlib.config import QlibConfig\nuri_type = QlibConfig.DataPathManager.get_uri_type(str(provider_uri))\nif uri_type not in (QlibConfig.LOCAL_URI, QlibConfig.NFS_URI):\n    raise ValueError(f'provider_uri {provider_uri!r} is neither a local path nor host:/path NFS form')","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Always use absolute local paths or host:/path remote forms for provider_uri.","On Windows with NFS data, supply mount_path for every configured frequency."],"tags":["qlib","config","uri","provider-uri"],"backgroundTag":null,"analyzedSha":"79633dd9506ea689e5400dea0197717b5b3d74b7","analyzedAt":"2026-08-15T07:01:27.511Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}