{"record":{"id":"64b0ec472e073669","repo":"MemPalace/mempalace","slug":"get-collection-requires-palace-or-a-positional-pa","errorCode":null,"errorMessage":"get_collection requires palace= or a positional palace_path","messagePattern":"get_collection requires palace= or a positional palace_path","errorType":"validation","errorClass":"TypeError","httpStatus":null,"severity":"error","filePath":"mempalace/backends/qdrant.py","lineNumber":1422,"sourceCode":"                PalaceRef(id=palace_path, local_path=palace_path),\n                collection_name,\n                bool(create),\n                options,\n            )\n        if \"palace_path\" in kwargs:\n            palace_path = kwargs.pop(\"palace_path\")\n            collection_name = kwargs.pop(\"collection_name\")\n            create = bool(kwargs.pop(\"create\", False))\n            options = kwargs.pop(\"options\", None)\n            if kwargs:\n                raise TypeError(\"unexpected arguments to get_collection\")\n            return (\n                PalaceRef(id=palace_path, local_path=palace_path),\n                collection_name,\n                create,\n                options,\n            )\n        raise TypeError(\"get_collection requires palace= or a positional palace_path\")\n\n    def close_palace(self, palace: PalaceRef | str) -> None:\n        palace_id = palace.id if isinstance(palace, PalaceRef) else palace\n        with self._lock:\n            collections = self._collections_by_palace.pop(palace_id, [])\n        for collection in collections:\n            collection.close()\n\n    def close(self) -> None:\n        with self._lock:\n            collections = [\n                collection\n                for palace_collections in self._collections_by_palace.values()\n                for collection in palace_collections\n            ]\n            self._collections_by_palace.clear()\n            self._clients.clear()\n            self._closed = True","sourceCodeStart":1404,"sourceCodeEnd":1440,"githubUrl":"https://github.com/MemPalace/mempalace/blob/06cb6987f02610784fefbad4b2bd5d026d164ba6/mempalace/backends/qdrant.py#L1404-L1440","documentation":"A TypeError raised when get_collection is called with neither palace= (PalaceRef keyword) nor a positional first argument to use as palace_path. Every calling convention requires identifying the palace first.","triggerScenarios":"get_collection(collection_name=\"drawers\", create=True) — only keyword collection options given, no palace in args or kwargs.","commonSituations":"Assuming the backend remembers the palace from a previous call; refactoring away the palace argument while building the request; defaulting arguments in a wrapper that accidentally drops the palace.","solutions":["Pass the palace: get_collection(palace_ref, \"drawers\") or palace=ref / palace_path=... forms","If wrapping get_collection, thread the palace argument through your wrapper"],"exampleFix":"# before\nbackend.get_collection(collection_name=\"drawers\", create=True)\n# after\nbackend.get_collection(palace=ref, collection_name=\"drawers\", create=True)","handlingStrategy":"validation","validationCode":"def open_collection(backend, palace, name: str, create: bool = False):\n    if palace is None:\n        raise ValueError(\"palace is required\")\n    return backend.get_collection(palace, name, create)","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Make palace a required first parameter of wrappers","Static-type the wrapper so a missing palace fails at lint time"],"tags":["qdrant","api-misuse","typeerror","missing-argument"],"backgroundTag":null,"analyzedSha":"06cb6987f02610784fefbad4b2bd5d026d164ba6","analyzedAt":"2026-08-15T03:03:36.213Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}