Error implementations (#232)

Solves #216 by adding a check on table open for existence of the
`.lance` file. Does not check for it for remote connections.
This commit is contained in:
Leon Yee
2023-06-27 16:48:31 -07:00
committed by GitHub
parent 4bc676e26a
commit eb5bcda337
7 changed files with 113 additions and 8 deletions

View File

@@ -123,6 +123,15 @@ def test_delete_table(tmp_path):
assert db.table_names() == ["test"]
def test_empty_or_nonexistent_table(tmp_path):
db = lancedb.connect(tmp_path)
with pytest.raises(Exception):
db.create_table("test_with_no_data")
with pytest.raises(Exception):
db.open_table("does_not_exist")
def test_replace_index(tmp_path):
db = lancedb.connect(uri=tmp_path)
table = db.create_table(