diff --git a/python/python/lancedb/permutation.py b/python/python/lancedb/permutation.py index 0788cb5cb..b70c96979 100644 --- a/python/python/lancedb/permutation.py +++ b/python/python/lancedb/permutation.py @@ -641,7 +641,7 @@ class Permutation: if split is not None: if permutation_table is None: raise ValueError( - "Cannot create a permutation on split `{split}`" + f"Cannot create a permutation on split `{split}`" " because no permutation table is provided" ) if isinstance(split, str): diff --git a/python/python/tests/test_permutation.py b/python/python/tests/test_permutation.py index 50ca53061..bc5c1649c 100644 --- a/python/python/tests/test_permutation.py +++ b/python/python/tests/test_permutation.py @@ -1404,3 +1404,10 @@ def test_permutation_over_remote_table(): ] assert_server_safe_row_id_requests(server) + + +def test_from_tables_split_without_permutation_table(mem_db): + tbl = mem_db.create_table("test_table", pa.table({"id": range(10)})) + + with pytest.raises(ValueError, match="permutation on split `train` because no"): + Permutation.from_tables(tbl, split="train")