{"record":{"id":"9c561a2d4cfdf1fb","repo":"lancedb/lancedb","slug":"no-split-named-name-found","errorCode":null,"errorMessage":"No split named `{name}` found","messagePattern":"No split named `(.+?)` found","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"python/python/lancedb/permutation.py","lineNumber":308,"sourceCode":"                }\n            else:\n                # No split names are defined in the permutation table\n                self.split_names = []\n                self.split_dict = {}\n        else:\n            # No metadata is defined in the permutation table\n            self.split_names = []\n            self.split_dict = {}\n\n    def get_by_name(self, name: str) -> \"Permutation\":\n        \"\"\"\n        Get a permutation by name.\n\n        If no split named `name` is found then an error will be raised.\n        \"\"\"\n        idx = self.split_dict.get(name, None)\n        if idx is None:\n            raise ValueError(f\"No split named `{name}` found\")\n        return self.get_by_index(idx)\n\n    def get_by_index(self, index: int) -> \"Permutation\":\n        \"\"\"\n        Get a permutation by index.\n        \"\"\"\n        return Permutation.from_tables(self.base_table, self.permutation_table, index)\n\n    def __getitem__(self, name: Union[str, int]) -> \"Permutation\":\n        if isinstance(name, str):\n            return self.get_by_name(name)\n        elif isinstance(name, int):\n            return self.get_by_index(name)\n        else:\n            raise TypeError(f\"Invalid split name or index: {name}\")\n\n\nclass Transforms:","sourceCodeStart":290,"sourceCodeEnd":326,"githubUrl":"https://github.com/lancedb/lancedb/blob/c7b051aff7039333a3f61b79217246c27676806a/python/python/lancedb/permutation.py#L290-L326","documentation":"Lookup failure in Permutation.get_by_name(): the requested split name has no entry in split_dict, i.e. the permutation table's metadata defines no such split. get_by_name is documented to raise rather than return None, and __getitem__ delegates to it.","triggerScenarios":"Calling permutation.get_by_name('train') when the permutation only defines splits like 'train_0'/'test_0', or via permutation['train'] with a misspelled name.","commonSituations":"Typos in split names; assuming default split names ('train'/'test') when the permutation uses indexed names; switching permutation configurations between runs.","solutions":["Print permutation.split_dict.keys() to see valid split names and use one of those exactly.","Correct the split name typo.","Use get_by_index with a valid index if the name is unknown."],"exampleFix":"// before\nperm = Permutation.create(table, frac=0.9)\ntrain = perm.get_by_name(\"train\")\n// after\ntrain = perm.get_by_name(\"train_0\")","handlingStrategy":"type-guard","validationCode":"if split_name not in perm.split_dict:\n    raise KeyError(f\"Available splits: {list(perm.split_dict)}\")","typeGuard":null,"tryCatchPattern":"try:\n    split = perm.get_by_name(name)\nexcept ValueError as e:\n    if \"No split named\" in str(e):\n        logging.error(f\"{name!r} not found; available: {list(perm.split_dict)}\")\n        raise KeyError(name) from e\n    raise","preventionTips":["Print perm.split_dict.keys() once after creating a Permutation to learn the naming scheme.","Never assume default names like 'train'; Permutation names splits with index suffixes.","Freeze split-name constants in shared config after creation."],"tags":["permutation","split","python"],"backgroundTag":"record-not-found","analyzedSha":"c7b051aff7039333a3f61b79217246c27676806a","analyzedAt":"2026-09-08T23:42:37.579Z","contentChangedAt":"2026-09-08T23:42:37.579Z","schemaVersion":2},"datasetVersion":"2026-09-17T15:17:12.973Z"}