{"record":{"id":"66309fb4405aef2f","repo":"RyanCodrai/turbovec","slug":"no-path-to-save-to-pass-folder-path-here-or-se","errorCode":null,"errorMessage":"No path to save to. Pass `folder_path=` here or set `path=` on the constructor.","messagePattern":"No path to save to\\. Pass `folder_path=` here or set `path=` on the constructor\\.","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"turbovec-python/python/turbovec/agno.py","lineNumber":1170,"sourceCode":"                    else:\n                        data[\"filters\"] = dict(metadata)\n\n    # ---- Persistence (JSON side-car) --------------------------------------\n\n    def save(self, folder_path: Optional[str] = None) -> None:\n        \"\"\"Persist the quantized index plus a JSON side-car to disk. Pass\n        ``folder_path`` to override the constructor's ``path=``.\n\n        Writes two files under ``folder_path``:\n          - ``index.tvim`` — the :class:`IdMapIndex` payload.\n          - ``docstore.json`` — JSON-encoded document text, metadata, and\n            id maps. Side-car carries a ``schema_version`` field; loaders\n            reject unknown versions rather than silently misinterpreting\n            bytes.\n        \"\"\"\n        path = folder_path if folder_path is not None else self.path\n        if path is None:\n            raise ValueError(\n                \"No path to save to. Pass `folder_path=` here or set \"\n                \"`path=` on the constructor.\"\n            )\n        if self._index is None:\n            raise RuntimeError(\n                \"TurboQuantVectorDb has no index to save — call create() first.\"\n            )\n        folder = Path(path)\n        folder.mkdir(parents=True, exist_ok=True)\n        # Serializes with writers: snapshotting the maps and the index\n        # concurrently with a write would persist a torn store to disk.\n        # Reads may proceed while a save runs.\n        with self._write_lock:\n            payload = {\n                \"schema_version\": _DOCSTORE_SCHEMA_VERSION,\n                # Round-trip int handles via list-of-pairs (JSON keys must be\n                # strings, but our handles are ints).\n                \"u64_to_doc\": [[h, d] for h, d in self._u64_to_doc.items()],","sourceCodeStart":1152,"sourceCodeEnd":1188,"githubUrl":"https://github.com/RyanCodrai/turbovec/blob/ccab9f325e6ce2a270a87daf01ae4e443bcf2d49/turbovec-python/python/turbovec/agno.py#L1152-L1188","documentation":"Raised in TurboQuantVectorDb.save when neither the folder_path argument nor the constructor's path= was provided, so there is no destination directory for the index.tvim / docstore.json pair. It fires before any I/O; the store simply has no configured persistence location.","triggerScenarios":"Thrown at turbovec-python/python/turbovec/agno.py:1170 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Call save(folder_path='/path/to/dir') with an explicit destination.","Re-construct the store with path='/path/to/dir' so save() has a default location.","Catch the ValueError in persistence glue code to report the missing configuration instead of crashing."],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"ccab9f325e6ce2a270a87daf01ae4e443bcf2d49","analyzedAt":"2026-09-06T08:39:18.516Z","contentChangedAt":"2026-09-06T08:39:18.516Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}