lancedb/lancedb · error · ValueError
No split named ` ` found
Error message
No split named `{name}` found What it means
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.
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.
Example fix
// before
perm = Permutation.create(table, frac=0.9)
train = perm.get_by_name("train")
// after
train = perm.get_by_name("train_0") Defensive patterns
Strategy: type-guard
Validate before calling
if split_name not in perm.split_dict:
raise KeyError(f"Available splits: {list(perm.split_dict)}") Try / catch
try:
split = perm.get_by_name(name)
except ValueError as e:
if "No split named" in str(e):
logging.error(f"{name!r} not found; available: {list(perm.split_dict)}")
raise KeyError(name) from e
raise Prevention
- 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.
When it happens
Trigger: 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.
Common situations: Typos in split names; assuming default split names ('train'/'test') when the permutation uses indexed names; switching permutation configurations between runs.
Understand the failure class
Background: Record Not Found Errors: "not found", RecordNotFound, and "was not found" — what they mean and how to fix them — this error's family across 28 libraries.
Related errors
- Cannot create a permutation on split
- Cannot create a permutation on split
- Cannot pickle table of type
- Cannot remove all columns
- Cannot rename column
AI-assisted analysis of lancedb/lancedb@c7b051aff7 (2026-09-08).
Data as JSON: /api/errors/9c561a2d4cfdf1fb.
Report an issue: GitHub.
Appendix: source
Thrown at python/python/lancedb/permutation.py:308
}
else:
# No split names are defined in the permutation table
self.split_names = []
self.split_dict = {}
else:
# No metadata is defined in the permutation table
self.split_names = []
self.split_dict = {}
def get_by_name(self, name: str) -> "Permutation":
"""
Get a permutation by name.
If no split named `name` is found then an error will be raised.
"""
idx = self.split_dict.get(name, None)
if idx is None:
raise ValueError(f"No split named `{name}` found")
return self.get_by_index(idx)
def get_by_index(self, index: int) -> "Permutation":
"""
Get a permutation by index.
"""
return Permutation.from_tables(self.base_table, self.permutation_table, index)
def __getitem__(self, name: Union[str, int]) -> "Permutation":
if isinstance(name, str):
return self.get_by_name(name)
elif isinstance(name, int):
return self.get_by_index(name)
else:
raise TypeError(f"Invalid split name or index: {name}")
class Transforms:View on GitHub (pinned to c7b051aff7)